home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume91 / utilitys / makemenu / part01 next >
Encoding:
Internet Message Format  |  1991-03-04  |  70.3 KB

  1. Path: news.larc.nasa.gov!amiga-request
  2. From: amiga-request@ab20.larc.nasa.gov (Amiga Sources/Binaries Moderator)
  3. Subject: v91i041: MakeMenu 1.0 - Intuition menu structure coding tool, Part01/02
  4. Reply-To: hj@philtis.cft.philips.nl (Hans Jansen @ PMSN)
  5. Newsgroups: comp.sources.amiga
  6. Message-ID: <comp.sources.amiga:v91i041@ab20.larc.nasa.gov>
  7. Date: 03 Mar 91 23:15:42 GMT
  8. Approved: tadguy@uunet.UU.NET (Tad Guy)
  9. X-Mail-Submissions-To: amiga@uunet.uu.net
  10. X-Post-Discussions-To: comp.sys.amiga.misc
  11.  
  12. Submitted-by: hj@philtis.cft.philips.nl (Hans Jansen @ PMSN)
  13. Posting-number: Volume 91, Issue 041
  14. Archive-name: utilities/makemenu-1.0/part01
  15.  
  16. [ includes uuencoded executables and objects  ...tad ]
  17.  
  18. This package aims to facilitate the design and coding of Intuition
  19. Menu structures.  It consists of two programs, the actual MakeMenu
  20. program, which creates a C code file from a simple menu description
  21. file, and a TestMenu program, which, when linked with the compiled
  22. output of MakeMenu, enables you to view the menu without having to
  23. build a complete application around it.  Adapted from menuBuilder on
  24. Fish Disk #65.  Version 1.0, includes source. 
  25. Author: Hans Jansen.
  26.  
  27.  
  28. #!/bin/sh
  29. # This is a shell archive.  Remove anything before this line, then unpack
  30. # it by saving it into a file and typing "sh file".  To overwrite existing
  31. # files, type "sh file -c".  You can also feed this as standard input via
  32. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  33. # will see the following message at the end:
  34. #        "End of archive 1 (of 2)."
  35. # Contents:  MakeMenu.doc README TestMenu.uu makefile makemenu.c
  36. #   makemenu.o.uu menu.c menu.o.uu menu.test testmenu.c testmenu.o.uu
  37. # Wrapped by tadguy@ab20 on Sun Mar  3 18:15:38 1991
  38. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  39. if test -f 'MakeMenu.doc' -a "${1}" != "-c" ; then 
  40.   echo shar: Will not clobber existing file \"'MakeMenu.doc'\"
  41. else
  42. echo shar: Extracting \"'MakeMenu.doc'\" \(7023 characters\)
  43. sed "s/^X//" >'MakeMenu.doc' <<'END_OF_FILE'
  44. X        MakeMenu V1.0 (15-oct-90) - by Hans Jansen
  45. X
  46. X
  47. X  This package aims to facilitate the design and coding of Intuition Menu
  48. X  structures.  It consists of two programs, the actual MakeMenu program, which
  49. X  creates a C code file from a simple menu description file, and a TestMenu
  50. X  program, which, when linked with the compiled output of MakeMenu, enables
  51. X  you to view the menu without having to build a complete application around
  52. X  it.
  53. X  
  54. XMakeMenu:
  55. X  
  56. X  This program was adapted from "Menu Builder V1.0" by Custom Services, as
  57. X  published on Fish Disk #65.
  58. X  The original program contains the following copyright statement:
  59. X
  60. X ___________________________________________________________________________
  61. X|                                                                           |
  62. X|      This Software is Copyrighted 1986 by Custom Services                 |
  63. X|      All rights to this and the generated data are the property           |
  64. X|      of Custom Services and may not be used for Commercial purposes       |
  65. X|      without the express written consent of Custom Services.              |
  66. X|___________________________________________________________________________|
  67. X  
  68. X  I adapted the program to my own, somewhat extended, needs because it
  69. X  originally only generated menu items with the CHECKIT attribute,
  70. X  without even so much as highlighting the selected item.
  71. X
  72. X
  73. X  Like its predecessor, MakeMenu takes a simple sequential file and
  74. X  from that file generates the menu structures for a program.
  75. X
  76. X  Call:
  77. X    MakeMenu ifile ofile
  78. X
  79. X  ifile :
  80. X    The menu descriptor file, containing lines of the form:
  81. X
  82. X    MENU,[Flags],Name
  83. X    ITEM,[Flags],Name,[Select],[Command]
  84. X    SUBI,[Flags],Name,[Select],[Command]
  85. X
  86. X    Name is the name of the Menu, Item or SubItem.
  87. X
  88. X    Select is an optional name which will display when the item is
  89. X    clicked upon.
  90. X  
  91. X    Command is the Character to use for selection of the menu item with
  92. X    the AMIGA key.  Only single letters A-Z are allowed.  The letters
  93. X    M and N are not allowed since Intuition uses these for screen control.
  94. X
  95. X    Flag (for menu entry):
  96. X    "D" specifies the menu to be disabled.
  97. X      Default attributes for a Menu's Flags field are:
  98. X    MENUENABLED.
  99. X
  100. X    Flags (for menu item entry):
  101. X    "D" specifies the menu to be disabled.
  102. X    "T" sets the item attribute MENUTOGGLE;
  103. X    "C" sets the item attribute CHECKIT;
  104. X    "S" sets the item attribute CHECKED ("Selected").
  105. X      Default attributes for an Item's or SubItem's Flags field are:
  106. X    ITEMENABLED | ITEMTEXT | HIGHCOMP.
  107. X      Note that no plausibility check is done on the combination of these 
  108. X      attributes!
  109. X
  110. X  ofile :
  111. X    The resulting C code file, compilable as is! You may, however,
  112. X    edit the source to modify the options.
  113. X
  114. X  Processing:
  115. X
  116. X    The text file is read line by line and the data saved in the regular
  117. X    Intuition structures.   After all data is read and no errors have
  118. X    been found the program will output to STDOUT all the text needed to
  119. X    generate the menu described.  If sub menus are specified the position
  120. X    of the sub menu will be about 40 % overlapped with the linked menu item.
  121. X
  122. X    The positioning of a menu will be automatically calculated based on the
  123. X    length of the strings used in the menu to the left of this one.  The
  124. X    widest string will be used to base the width.  Most of this processing
  125. X    is contained in the function Do_Output; change its parameters as needed.
  126. X
  127. X    The structs Menu, MenuItem, and IntuiText will be generated as needed
  128. X    to define the menus based on the input file.
  129. X
  130. X  You will need to include the statement:
  131. X
  132. X    extern struct Menu *MyMenu;
  133. X
  134. X  in your source program and call:
  135. X
  136. X    SetMenuStrip (window_ptr, MyMenu);
  137. X
  138. X  Also, before you close your window you must call:
  139. X
  140. X    ClearMenuStrip (window_ptr);
  141. X
  142. X  or risk a spectacular crash!
  143. X
  144. XTestMenu:
  145. X
  146. X  This program was adapted from the Intuition/Menus example in pages
  147. X  125-133 of the V1.3 RKM "Libraries and Devices:, also published on
  148. X  Fish Disk #344 (the "Libs&DevsCompanion").  On that disk, the program
  149. X  carried the following copyright statement:
  150. X    
  151. X/* Copyright (c) 1990 Commodore-Amiga, Inc.
  152. X *
  153. X * This example is provided in electronic form by Commodore-Amiga, Inc. for
  154. X * use with the 1.3 revisions of the Addison-Wesley Amiga reference manuals. 
  155. X * The 1.3 Addison-Wesley Amiga Reference Manual series contains additional
  156. X * information on the correct usage of the techniques and operating system
  157. X * functions presented in this example.  The source and executable code of
  158. X * this example may only be distributed in free electronic form, via bulletin
  159. X * board or as part of a fully non-commercial and freely redistributable
  160. X * diskette.  Both the source and executable code (including comments) must
  161. X * be included, without modification, in any copy.  This example may not be
  162. X * published in printed form or distributed with any commercial product.
  163. X * However, the programming techniques and support routines set forth in
  164. X * this example may be used in the development of original executable
  165. X * software products for Commodore Amiga computers.
  166. X * All other rights reserved.
  167. X * This example is provided "as-is" and is subject to change; no warranties
  168. X * are made.  All use is at your own risk.  No liability or responsibility
  169. X * is assumed.
  170. X */
  171. X
  172. X  This program, when linked with the (compiled) output from MakeMenu,
  173. X  will enable you to fast-prototype your menu design.  The program will
  174. X  report the menu/item/subitem numbers for any selection you make.
  175. X
  176. XUsage of the package:
  177. X
  178. X  Build your menu description file with any text editor.  Run it through
  179. X  MakeMenu by a command like
  180. X    MakeMenu menu.test menu.c
  181. X  Then compile the resulting .c file and link the object with your own
  182. X  application.  That is all there is to it!
  183. X
  184. X  The supplied makefile (for PDC V3.3) will automatically build a new
  185. X  executable for the test program TestMenu, when you define a new menu in
  186. X  the file Menu.Test; the resulting output file will be called Menu.c.
  187. X  When all goes well, it will also run the TestMenu program to let you
  188. X  view your menu.
  189. X
  190. XBugs:
  191. X
  192. X  You must be kidding! I don't write any bugs into my software! [(:-)]
  193. X  However, should you find anything wrong with the program, I should be
  194. X  pleased to hear about it.  Please e-mail me to the address below.
  195. X
  196. X  Notice that currently there is no way to generate mutual-exclusion
  197. X  flags.  Should I ever appear to need that functionality, I will probably
  198. X  add it and repost the package.  I have no way to predict when that will
  199. X  be, if ever.
  200. X  You are free to do with the package as you like; but in case of any
  201. X  extensions being added I should still like to have a copy.
  202. X
  203. X  This package has been developed using PDC V3.33.  I have not tried to
  204. X  produce a makefile compatible to Aztec or SAS C; but I do not believe
  205. X  adaptation to those environments will give any problems.
  206. X
  207. X--
  208. XJ (Hans) W Jansen @ Philips Medical Systems Nederland, Dept. DA&S-EDM
  209. XBuilding QP-1115    PO Box 10000    5680 DA Best      The Netherlands
  210. XUUCP: hj@philtis.cft.philips.nl                 Voice: +31 040 763342
  211. END_OF_FILE
  212. if test 7023 -ne `wc -c <'MakeMenu.doc'`; then
  213.     echo shar: \"'MakeMenu.doc'\" unpacked with wrong size!
  214. fi
  215. # end of 'MakeMenu.doc'
  216. fi
  217. if test -f 'README' -a "${1}" != "-c" ; then 
  218.   echo shar: Will not clobber existing file \"'README'\"
  219. else
  220. echo shar: Extracting \"'README'\" \(474 characters\)
  221. sed "s/^X//" >'README' <<'END_OF_FILE'
  222. XThis package aims to facilitate the design and coding of Intuition
  223. XMenu structures.  It consists of two programs, the actual MakeMenu
  224. Xprogram, which creates a C code file from a simple menu description
  225. Xfile, and a TestMenu program, which, when linked with the compiled
  226. Xoutput of MakeMenu, enables you to view the menu without having to
  227. Xbuild a complete application around it.  Adapted from menuBuilder on
  228. XFish Disk #65.  Version 1.0, includes source. 
  229. XAuthor: Hans Jansen.
  230. X
  231. END_OF_FILE
  232. if test 474 -ne `wc -c <'README'`; then
  233.     echo shar: \"'README'\" unpacked with wrong size!
  234. fi
  235. # end of 'README'
  236. fi
  237. if test -f 'TestMenu.uu' -a "${1}" != "-c" ; then 
  238.   echo shar: Will not clobber existing file \"'TestMenu.uu'\"
  239. else
  240. echo shar: Extracting \"'TestMenu.uu'\" \(16283 characters\)
  241. sed "s/^X//" >'TestMenu.uu' <<'END_OF_FILE'
  242. Xbegin 700 TestMenu
  243. XM```#\P`````````;`````````!H````"````#@```<$```:_````!P````4`.
  244. XM```'````!P````0````$````!`````4````'````!@````8````&````!0``]
  245. XM``4````%````!0````8````%````!0````8````%````!P````8```/I````C
  246. XM`D[Y```````````#[`````$````#`````@````````/R```#ZP````X```/RD
  247. XM```#Z@```<$`(0`!````````````````____________________________\
  248. XM____````````````````````````````````````````````````````````]
  249. XM`````````````````````````````````````````````````````````````
  250. XM`````````````````````````````````````````````````````````````
  251. XM`````````````````````````````````````````````````````````````
  252. XM`````````````````````````````````````````````````````````````
  253. XM`````````````````````````````````````````````````````````````
  254. XM`````````````````````````````````````````````````````````````
  255. XM`````````````````````````````````````````````````````````````
  256. XM`````````````````````````````````````````````````````````````
  257. XM``````````````,``0``%``4````````!9P`````````"@*``&0"`0```P``#
  258. XM`A`.``````````````5P````````````````_____P`!``$!```3````````G
  259. XM```&J````````0$``!,```````````:B```````!`0``$P``````````!IP`B
  260. XM``````$!```3```````````&E````````0$``!,```````````:.```````!9
  261. XM`0``$P``````````!HH```````$!```3```````````&A````````0$``!,`8
  262. XM``````````9Z```````!`0``$P``````````!G0```````$!```3````````D
  263. XM```&;@```````0$``!,```````````9J```````!`0``$P``````````!F0`X
  264. XM``````$!```3```````````&7@```````0$``!,```````````94```````!I
  265. XM`0``$P``````````!DX```````$!```3```````````&1````````0$``!,`<
  266. XM``````````8T```````!`0``$P``````````!B@````````#D@`X``(`8P`*Y
  267. XM`%(````````";`````````````#__P``````.``,`&,`"@!2`````````H``#
  268. XM````````````__\```/6``````!C``H`4@````````((`````````````/__>
  269. XM```#^`````H`8P`*`%8````````"'`````!/``````#__P``!!H````4`&,`(
  270. XM"@!6`````````C``````4P``````__\```0\````'@!C``H`4@````````)$&
  271. XM`````````````/__```$7@```"@`8P`*`%(````````"6````````````W#_3
  272. XM_P``!(`````R`&,`"@!2`````````I0`````````````__\`````````/`!CG
  273. XM``H`5@````````*H`````%$``````/__```$Q```````6P`*`%8````````">
  274. XMO`````!:``````#__P``!.8````*`%L`"@!6`````````M``````6```````M
  275. XM__\```4(````%`!;``H`5@````````+D`````$,``````/__```%*@```!X`.
  276. XM6P`*`%8````````"^`````!6``````#__P`````````H`%L`"@!"````````8
  277. XM`PP`````````````__\```5N``````"#``H`4@````````,@````````````"
  278. XM`/__```%D`````H`@P`*`5L````````#-`````````````#__P``!;(````4&
  279. XM`(,`"@%3`````````T@`````````````__\`````````'@"#``H`4P``````H
  280. XM``-<`````````````/__```%\@``````8P`*``$```8&```#M```````````%
  281. XM```&$`!P````6P`*``$```7F```$H@````````````````#8````@P`*``$`C
  282. XM``7````%3``````````````%U$YQ0T]..C,P+S,P+S(P,"\Q-3`O5V]R:V)E<
  283. XM;F-H````!E````90``````````$P,3(S-#4V-S@Y04)#1$5&``!.<0``````'
  284. XM```````````````````````````4`````$YQ```&L```````````````````)
  285. XM````````````````!LP```````````````````````````````````;H`````
  286. XM`````````````````````````````````````````````````````````````
  287. XM`````````^P````L`````@``!I0```:P```&S```!E````94```#<````X(`G
  288. XM``.D```#M````\8```/6```#Z````_@```0*```$&@``!"P```0\```$3@``4
  289. XM!%@```1>```$<```!)(```2B```$M```!,0```36```$Y@``!/@```4(```%`
  290. XM&@``!3P```5,```%7@``!6X```6````%D```!:(```7$```%U```!>8```7R'
  291. XM```&!```!B(```8N````%P````,```(4```"*````CP```)0```"9````G@`P
  292. XM``*,```"H````K0```+(```"W````O````,$```#&````RP```-````#5```K
  293. XM`V@```7B```&````!AX```'0```!\@````````/R```#Z0``!K\CSP```"@CC
  294. XMP````#`CR````#0L>``$(\X````$D\E.KO[:*$!*K`"L9P`!"&$``A"1R"`LN
  295. XM`*SEB"`P"!#EB$CG`#!%^0```+A'^0```#@@0'``$!A",`@`)L@@.0```#`@$
  296. XM>0```#1#\`@`#"$`(%+(__I"*0`!$AAG7`P!`"!G]@P!``EG\";*#`$`(F<4R
  297. XM%,$2&&="#`$`(&<$%,%@\D(:8-02&&<P#`$`(F?R#`$`*F8@$A@,`0!.9P8,[
  298. XM`0!N9@1R"F`.#`$`16<&#`$`968"<AL4P6#,0A)"DR`\````-)"+1H#DB$S?;
  299. XM#`!(>0```#@O`$ZY`````"/`````$"/`````'$ZY`````"/`````%"/`````.
  300. XM&"/`````("/`````)$ZY```&K'``+GD````H3G5A``$*80``]"/`````+"\`<
  301. XM0J<D0"`J`"1G#BQY````""!`(A!.KO^"0?D```8T#!```&=0(@@D/````^TL9
  302. XM>0````A.KO_B#(``````9T0CP````!`CP````!0CP````!@CP````!PCP```<
  303. XM`"`CP````"0I0`"<*4``H.6(($`I:``(`*1.N0``!JQP`&`$("\`!$JY````B
  304. XM+&<2(CD````0:PHL>0````A.KO_<+GD````H+P`L>``$(#D````(9P8B0$ZN;
  305. XM_F)*N0```"QG#DZN_WPB>0```"Q.KOZ&(!].=4CG`08N/``#@`<L>``$3J[_1
  306. XME$S?8(!P9&"80>P`7$ZN_H!![`!<3J[^C$YU0_H`$G``3J[]V"/`````"&?"D
  307. XM3G5D;W,N;&EB<F%R>0!.<4Y5__9(YQP`<``H`$ZY```#^G`!('D```'`(&@`]
  308. XM5A(H``]T`!0!(@+CH"8`2H1F(B\#3KD`````6$\J`,"#9Q`O.0```<!.N0``_
  309. XM`L183R@`8-I"ITZY```$K%A/3-\`.$Y=3G5.5?_D2.<?.$7Y```)3'``+`!P2
  310. XM`"@`(&T`""\H`%9.N0````!83R@`9P`!`B!$*V@`%/_P($0[:``8__PO!$ZYX
  311. XM`````%A/<``@+?_P3KD``!K"```#+@```@````,V```!``````````/L<`$LO
  312. XM`&```+AP`#`M__Q(P"8`#(/_____9P``H"`#`H`````?*$`@`^J``H`````_:
  313. XM)D!P"R(#X*$"@0```!\J`2\#+SD```8N3KD`````4$\@0#`H``Q(P"X`+PLOK
  314. XM#$AY```%5DZ2WOP`#`R%````'V<,+P5(>0``!4A.DE!/(`<"@````0!G"DAYN
  315. XM```%/$Z26$](>0``!3I.DEA/+P,O.0``!BY.N0````!03R!`,"@`($C`)@!@I
  316. XM`/]:8````F``_NP@!DS?'/A.74YU3E4``$CG`#!%^0```<!'^0``!*Q(>``AJ
  317. XM2'D```4H3KD`````4$\CP````;@@.0```;AF"$AX``5.DUA/2'@`(4AY```%D
  318. XM%DZY`````%!/(\````&\(#D```&\9@A(>``%3I-83TAY```!V$ZY`````%A/U
  319. XM)(`@$F8(2'@`!4Z36$]"IT*G2'D```'$(%(O*``R3KD`````WOP`$"\Y```&#
  320. XM+B\23KD`````4$],WPP`3EU.=4Y5```O"D7Y```!P"`29QP@4B`H`!QG"B\22
  321. XM3KD`````6$\O$DZY`````%A/(#D```&\9PXO.0```;Q.N0````!83R`Y```!5
  322. XMN&<.+SD```&X3KD`````6$\O+0`(3KD```FL6$\D7TY=3G5G<F%P:&EC<RYL?
  323. XM:6)R87)Y``!I;G1U:71I;VXN;&EB<F%R>0`*`"`H0VAE8VME9"D@`"P@<W5BG
  324. XM:71E;2`E9```4V5L96-T960@;65N=2`E9"P@:71E;2`E9`!497-T365N=2!6.
  325. XM,2XP("@Q,BUO8W0M.3`I("T@8GD@2&%N<R!*86YS96X``$%C=&EV871E($UE@
  326. XM;G5)=&5M(&]R($-L;W-E1V%D9V5T``!.<2!0<F5F97)E;F-E<R`@("`@("`@F
  327. XM("`@("`@("`@("`@("`@("``("!%9&ET("`@("`@("`@("`@("`@("`@("`@&
  328. XM("`@(``@4')O:F5C="`@("`@("`@("`@("`@("`@("`@("`@("``16%T($ET.
  329. XM(%1O;P``2&%V92!9;W5R($-A:V4``$%U=&\@4V%V90!3;W5N9`!%<F%S92!!;
  330. XM;&P`4&%S=&4`0V]P>0``0W5T`%5N9&\``%%U:70``$%B;W5T+BXN``!$<F%F7
  331. XM=`!.3%$`4')I;G0`4V%V94%S``!3879E``!/<&5N``!.97<`3E4``$CG`#!%!
  332. XM^0``!HY'^0``!^1P%#/````&C$AX`*!.N0``#C!83R2`(!)F'$*G2'D``0``0
  333. XM3KD`````4$](>``!3KD```'`6$\P/!``2,`@4B%```0@4B"Y````$$AY```'4
  334. XMK$*G3I-03R/`````+#`\$`%(P"!2(4``#"!2(7D````4``A(>0``!ZI(>``!C
  335. XM3I-03R/`````,"!2("@`"&<V2'@#[4AY```'J$ZY`````%!/(%(A0``0(%(`-
  336. XMJ`````$`%$AY```'IDAX``).DU!/(\`````T+RT`#"\M``A.N0```F!03T*G!
  337. XM3KD```FL6$],WPP`3EU.=7<`*@!W`'(`3G%.50``2'@`!$AY```'X$ZY````G
  338. XM`"\`3KD`````WOP`#$AX``%.N0``":Q83TY=3G5>0PH`3E7__"\#3KD```K*$
  339. XM)@!F""`#)A].74YU($,A;0`(``1P`7(`$@`@`2!#,4``&B\#3KD``!`(6$]*M
  340. XM@&<(($,`:``@`!H@`V#*3E7__$CG&``F+0`(<``H`$J#9@IP_TS?`!A.74YUV
  341. XM($,P*``:9U8@0S`H`!IR`#(`(`$"@`````)G$$AX__\O`TZY```,P%!/*``@1
  342. XM0R\H``1.N0``$CQ83XB`($,P*``:<@`R`"`!`H`````09PX@0R\H`!1.N0``8
  343. XM#K)83W``($,A0``4<``@0R%```AP`"!#(4``#'``<@`2`"`!($,Q0``:(`1@R
  344. XM`/]P3E4``$AX__\O+0`(3KD```S`4$].74YU3E4``"\Y`````"\M``A.N0``*
  345. XM"AA03TY=3G5.50``+P,F+0`(('D````$4KD````$$(,@`R8?3EU.=4Y5```CZ
  346. XM[0`(`````$AM`!`O+0`,2'K_L$ZY```4IM[\``Q.74YU3E4``"/Y````,```7
  347. XM``!(;0`,+RT`"$AZ_XA.N0``%*;>_``,3EU.=4Y5__PO`R/M``@````$2&T`D
  348. XM$"\M``Q(>O]Z3KD``!2FWOP`#"8`('D````$0A`@`R8?3EU.=4YQ3E7__"\#4
  349. XM(#D````D9P@@>0```"1.D"`Y```&CF<L<``F`#`Y```&C$C`MH!L#B\#3KD`)
  350. XM`!(\6$]2@V#F+SD```:.3KD```ZR6$\@.0```"AG""!Y````*$Z0+RT`"$ZYT
  351. XM```!P%A/)A].74YU3E7_^DCG'``F+0`,*"T`"!M$__\@0R`H``@@0["H``QM"
  352. XM%"\$+P-.N0``#,!03TS?`#A.74YU(D,@:0`(4JD`"!"$($,P*``:<@`R`"`!C
  353. XM`H`````@9R@,A`````IG"`R$````#688+P0O`TZY```,P%!/*@`@0U.H``@@<
  354. XM!6"P(`1@K$YQ3E7_^$CG&`!!^0``!I0F"$J#9Q(@0R@0+P-.N0``""Q83R8$&
  355. XM8.I,WP`83EU.=4Y5__A(YQ@`(#D````D9@I!^O_`(\@````D0?D```:4)@A*>
  356. XM@V<2*`,@0S`H`!IF`F`&($,F$&#J2H-F)$AX`!Q.N0``#C!83R8`9@IP`$S?]
  357. XM`!A.74YU($0@@W``($,@@'``($,A0``(<``@0R%```QP`"!#(4``%'``<@`2X
  358. XM`"`!($,Q0``:(`-@Q$Y5__PO`R8M``A(>`0`3KD```XP6$\@0R%``!0@*``4E
  359. XM9A@@`P:`````&"!#(4``%'`!($,A0``08!0@0P!H`!``&C`\!`!(P"!#(4``!
  360. XM$"!#+R@`!$ZY```0"%A/2H!G""!#`&@`(``:)A].74YU3E7_^$CG'``F+0`(%
  361. XM($,P*``:<@`R`"`!`H`````,9PIP_TS?`#A.74YU($,":/_]`!H@0R`H`!1FA
  362. XM""\#3KK_5%A/($,P*``:<@`R`"`!`H````"`9SI!^0``!I0H"$J$9RX@0S`H;
  363. XM`!IR`#(`(`$"@````((,@````()F#DAX__\O!$ZY```,P%!/($0H$&#.($,OD
  364. XM*``0($,O*``4($,O*``$3KD``!!DWOP`#"H`;S(@0R)#(V@`%``(($,@*``4>
  365. XMT(4@0R%```PB0R!I``A2J0`($!!(@$C``H````#_8`#_0DJ%;`H@0P!H``@`(
  366. XM&F`(($,`:``$`!IP_V``_R9.5?_Z2.<<`"8M``@H+0`,&T3_^R!#,"@`&G(`B
  367. XM,@`@`0*`````"&<*</],WP`X3EU.=2!#,"@`&G(`,@`@`0*``````F<N($,@$
  368. XM*``(($.0J``4*@`O!2!#+R@`%"!#+R@`!$ZY```1!-[\``RPA6<$8```H@R$]
  369. XM_____V8<($,":/_]`!IP`"!#(4``"'``($,A0``,<`!@DB!#("@`%&8(+P-.L
  370. XMNOWP6$\@0R`H`!`,@`````%F*$AX``%(;?_[($,O*``$3KD``!$$WOP`#`R`@
  371. XM`````6<"8#P@!&``_TX@0R)#(V@`%``(($,@*``4($/0J``0($,A0``,($,`C
  372. XM:``"`!HB0R!I``A2J0`($(0@!&``_Q@@0P!H``@`&G``($,A0``(<``@0R%`)
  373. XM``QP_V``_OI.<4Y5__A(YQ@`0?D```90)B@`!`R#```&4&<:($,H*``$($,O$
  374. XM*``(+P-.N0````!03R8$8-Y,WP`83EU.=4Y5__A(YQP`*BT`"&8*</],WP`XG
  375. XM3EU.=2`%!H`````,*`!(>0`!```O!$ZY`````%!/)@!F!'``8-9!^0``!E`@.
  376. XM:``$((-!^0``!E`B0R-H``0`!$'Y```&4"%#``1!^0``!E`B0R*(($,A1``(^
  377. XM0?K_5"/(````*`:#````#"`#8(Y.5?_T2.<<`"`M``@$@`````PF`"!#*"@`F
  378. XM!"!#*A`@1"`0L(-G"$S?`#A.74YU($,O*``(+P-.N0````!03R!$((4@12%$5
  379. XM``1@W$Y5__A(YQ@`+RT`#"\M``A.N0``%]0@'UA/*``O!$ZZ_Q183R8`+P0OJ
  380. XM`TZY```/O%!/(`-,WP`83EU.=4Y5__1(YQ\`)BT`#"XM``@@!P2`````#"@`-
  381. XM($0L*``$($8@$+"$9PIP`$S?`/A.74YU+P-.NO["6$\J`"!$MJ@`"&,(($0@\
  382. XM*``(8`(@`R8`+P,O!2\'3KD```^<WOP`#"`%8,9.50``+RT`$"\M``@O+0`,U
  383. XM3KD``!&8WOP`#$Y=3G5.<4Y5```O+0`,0J<O+0`(3KD```_8WOP`#$Y=3G5.K
  384. XM5?_V2.<>`"HM``@L!2@M``PF+0`02H-O"B!&4H80A%.#8/(@!4S?`'A.74YUA
  385. XM3G%.5?_\2.<8`"8M``@@.0``!HXB`^>!T($H`'``L(-N$C`Y```&C$C`MH!N\
  386. XM!B!$(!!F$G`#(\````:(</],WP`83EU.=2!$+Q!.N0````!83TJ`9P1P`6`"O
  387. XM0H!@X$Y5__A(YQP@*"T`"$7Y```&B$ZY```2""`Y```&CB($YX'0@28`<`"PC
  388. XMA&X2,#D```:,2,"X@&P&($,@$&8.<`,D@'#_3-\$.$Y=3G4@0R`H``0"@```$
  389. XM``,,@`````%F"'`")(!P_V#<+RT`$"\M``P@0R\03KD`````WOP`#"H`#(7_<
  390. XM____9@Q.N0`````D@'#_8+!.N0``$@@@!6"F3G%.5?_X2.<<("@M``A%^0``$
  391. XM!HA.N0``$@@@.0``!HXB!.>!T($F`'``L(1N$C`Y```&C$C`N(!L!B!#(!!FK
  392. XM#G`#)(!P_TS?!#A.74YU($,@*``$`H`````#9@AP`B2`</]@XB\M`!`O+0`,F
  393. XM($,O$$ZY`````-[\``PJ``R%_____V8,3KD`````)(!P_V"V(`5@LDYQ3E7_`
  394. XM]$CG'P`L+0`0+BT`"$J&;@H@!TS?`/A.74YU*BT`#"@'NH1N,"`&4X`B!=*`N
  395. XM(`&PA&TB(`93@-J`(`93@-B`)@9*@V\.($53A2)$4X02D%.#8.Y@%"8&2H-O:
  396. XM#B!%4H4B1%*$$I!3@V#N(`=@IDY5__PO`TAX,`!"ITZY`````%!/)@`"@```P
  397. XM,`!G#B`Y```&7&<&3KD```>P(`,F'TY=3G5.5?_\2.<8`"@M``@@.0``!HXBR
  398. XM!.>!T($F`'``L(1N$C`Y```&C$C`N(!L!B!#(!!F$G`#(\````:(</],WP`85
  399. XM3EU.=2!#("@`!`*````0`&8,($,O$$ZY`````%A/<``@0R%```1P`"!#((!P,
  400. XM`&#,3E7_]$CG'R`H+0`,+BT`"$7Y````"`R$@````&9:<``@$DZY```:P@``/
  401. XM$O0````(```2_@````H``!,(````$````````!,20?D``!?()@A@'$'Y```7,
  402. XMO"8(8!)!^0``%[(F"&`(0?D``!>J)@@@`TS?!/A.74YU<``@$@R`````"F8(\
  403. XM2H1L!'`!8`)"@"P`9P8@!$2`*``J!"`'!H````0`)@!3@R!#0A!!^0``!F`O;
  404. XM$B\%3KD``!IT(!]83]'`4X,B0Q*0+Q(O!4ZY```9,BH?6$]*A6<((`=2@+:`3
  405. XM;LI*AF<(4X,@0Q"\`"T@`V"`3E7_\$CG'S`N+0`(1?D````@1_D````0<`$FD
  406. XM`"\'3KD``!K46$\J`+J3;P(J$R`Y````&&=T(#D````4#(`````@9Q(@1Q`0<
  407. XM2(!(P"@`#(0````M9P@,A````"MF("\$(%).D%A/#(#_____9@IP_TS?#/A.S
  408. XM74YU4H-2AU.%4[D````,(#D````,L(5M'"\Y````%"!23I!83PR`_____V8$&
  409. XM</]@RE*#8-1P`"P`O)-L)B!'4H<0$$B`2,`H`&<8+P0@4DZ06$\,@/____]F.
  410. XM!'#_8)Q2AF#6UH:VN0````QL'$AX`"`@4DZ06$\,@/____]F!G#_8`#_>%*#"
  411. XM8-S7N0```!P@`V``_VA.5?OL2.<?."@M``Q%^0```!!)^0````PC[0`(````W
  412. XM("HM`!!P`"/`````'"!$$!!(@$C`)@!G``+(#(,````E9R8O`R!M``A.D%A/N
  413. XM#(#_____9@IP_TS?'/A.74YU4H12N0```!Q@Q%*$($00$$B`2,`F``R#````4
  414. XM)68@+P,@;0`(3I!83PR`_____V8$</]@Q%*$4KD````<8)!P`2/`````&'`$)
  415. XM+@!P`"2`*))P("/`````%`R#````+684<``CP````!A2A"!$$!!(@$C`)@`,`
  416. XM@P```#!F%'`P(\`````44H0@1!`02(!(P"8`#(,````J9A0@15B%*)!2A"!$[
  417. XM$!!(@$C`)@!@,G``<#"P@VXJ#(,````Y8B(@%-"`(@#E@="!T(,$@````##1$
  418. XME%*$($00$$B`2,`F`&#.#(,````N9EI2A"!$$!!(@$C`)@`,@P```"IF%"!%W
  419. XM6(4DD%*$($00$$B`2,`F`&`R<`!P,+"#;BH,@P```#EB(B`2T(`B`.6!T('0%
  420. XM@P2`````,-&24H0@1!`02(!(P"8`8,X,@P```&QG"`R#````3&82<`0N`%*$-
  421. XM($00$$B`2,`F`&`@#(,```!H9P@,@P```$AF$'`"+@!2A"!$$!!(@$C`)@`@]
  422. XM$@R````#_FP$(!)F"#`\`_Y(P"2`<`!R`!(`(`$CP`````A2A'``(`-.N0``X
  423. XM&L(``!;F````>```%NP```!O```6\@```&0``!=*````<P``%W@```!C````S
  424. XM````%WY0N0````A0N0````AP`"`Y````"&8.<`IR`!(`(`$CP`````@,AP``9
  425. XM``1F""!%6(4F4&`*($54A3`02,`F0"\+2&W[[$ZZ^X!03RP`+P9.NOQF6$\,V
  426. XM@/____]F!G#_8`#]MF!8($58A2P0(!1G!"248`@P/'_-2,`D@"\&3KK\.%A/;
  427. XM#(#_____9@9P_V``_8A@*B!%6(4F$!M#^^Q![?OL0B@``4AM^^Q.NOP,6$\,N
  428. XM@/____]F!G#_8`#]7&``_2Y@`/U4+4]/4%,M```X,#`P,#`P,```+3(Q-#<T>
  429. XM.#,V-#@`,C`P,#`P,#`P,#``3E8``$CG^`!*;@`(9AI*;@`,9A0P+@`*P.X`^
  430. XM#BU```A,WP`?3EY.=7@!)"X`"&P$1()$A"8N``QL!$2#1(1"@#`"P,,R`DA"A
  431. XMQ,-(0\+#TH)(04)!T(%*A&P"1(`M0``(3-\`'TY>3G5.5@``2.?P`$IN``AG@
  432. XM+DIN``QF)"0N``@F+@`,0H`P`L##,@)(0L3#2$/"P]*"2$%*068$T(%D$G#_*
  433. XM8`Y*;@`,9M(P+@`*P.X`#BU```A,WP`/3EY.=4Y6```O`$IN``QF'"`N``AK&
  434. XM%H#N``YI$`*```#__RU```@@'TY>3G5(YWP`>@$@+@`(;`1$@$2%)@`B+@`,I
  435. XM;`1$@42%*`$,@0`!``!L%$)`2$"`P30`,`.`P4A`,`)(0&`JXHCBB0R!``$`7
  436. XM`&ST@,$"@```__\D`"\`+P1A`/[$(!]83[:`;`)3@B`"2H5L`D2`+4``"$S?L
  437. XM`#X@'TY>3G5.5@``+P`@+@`(2FX`#&8\@.X`#FD0`H```/__+4``""`?3EY.>
  438. XM=4CG8``R+@`.=`!(0#0`A,$]0@`(2$(P`DA`@,$]0``*3-\`!F#42.=\`"(N:
  439. XM``RP@6X*9P1P`&!"<`%@/BH`)@'BB.*)#($``0``;/2`P0*```#__R0`+P,O;
  440. XM`F$`_H@@'UA/L(5G$FT$4X)@ZB@%F("X@V\$4H)@WB`"+4``"$S?`#Y@`/]VG
  441. XM3E8``$CG^`!*;@`,9AP@+@`(:Q:`[@`.:1!"0$A`+4``"$S?`!].7DYU>`$@N
  442. XM+@`(;`1$@$2$)``B+@`,;`)$@0R!``$``&P00D!(0(#!,`*`P4)`2$!@+"8!J
  443. XMXHCBB0R!``$``&ST@,$"@```__\O`"\#80#]@B`?6$^T@&0"D(.0@D2`2H1LH
  444. XM`D2`+4``"$S?`!].7DYU3E8``$CG\``@+@`(2FX`#&86@.X`#FD00D!(0"U`Y
  445. XM``A,WP`/3EY.=28N``PD`"\#+P!A`/Z*+P-A`/V.(A]03Y2!+4(`"$S?``].1
  446. XM7DYU(%\B6"()9P:PF&;V3M$@4$[03E7_^$CG&`!P`"8`*"T`""!$4H00$&<$<
  447. XM4H-@]"`#3-\`&$Y=3G5.<0```^P````K`````0``$KX``!.J```3L```$\P`&
  448. XM`!/4```4'```%"(``!0L```4>```%)P``!2T```4N@``%,(``!3.```5"```T
  449. XM%3P``!5&```56```%6@``!6$```6I@``%N@``!;N```6]@``%P8```ZD```*2
  450. XMU```"N````GX```*````";0```F\```)4@``"/(```D2```)&```"2X```E6R
  451. XM```)?@``"9P```>````'0@``!Q@```!2`````@``$U@``!)R```27@``$DH`J
  452. XM`!(H```1,@``$1X``!$2```0D@``$'X``!!R```0/@``$"H``!`6```-_@``Z
  453. XM#@@```YL```.>```#H8```Z0```*I@``"N8```P:```)T```"<0```GJ```'N
  454. XM+```!P8```;$```&M@```W(```/.```$E@```G8```*B```$!```!"(```0H5
  455. XM```$2@``!%````1@```$@```!+0```3:```$X@``!/````3X```!7`````(`5
  456. XM```(````#@```!@```!$````2@```%P```!B````W````.P```#Z```!````]
  457. XM`0P```$2```!&````1X```$L```!/````4X```%P```!@@```8@```&.```!>
  458. XME````9H```&@```!Q@```<X```'6```!X````>P```'Z```"!@```DH```!0J
  459. XM`````P``$[P``!-X```38@``$M```!:R```2U```$MP``!+D```2\```$O8`0
  460. XM`!,````3"@``$Q0``!:V```6O@``%L8``!;.```6U@``%N(``!(P```1&```&
  461. XM$'@``!#Z```/S```#ZX```^0```/*```#PX```TD```-A@``#&8```NJ```+3
  462. XM#```"V0```JX```,1@``"D````J$```*#```"?````G>```)0```"6@```F0P
  463. XM```(_```"*(```A^```(;@``".(```@6```'[```!]8```>Z```'F```!XX`W
  464. XM``;P```&S@``!KP```<,```'-```!U0```=R```%"@```Q(```+.```";@``2
  465. XM`J@```*V```#%@```QX```,J```#C@```Z0```.X```#P@``!`H```04```$K
  466. XM/````20```&X`````0````0```=:`````0````4``!*4`````0````8``!#:=
  467. XM`````@````<``!%T```'R`````$````(````]`````(````)```'P````08`S
  468. XM```"````"@``$8@``!#N`````0````L``!!2`````0````P```;D`````0``)
  469. XM``T```Y<`````@````X```X>```.Z@````$````/```2%@````$````0```"V
  470. XME`````$````1```"Y`````$````2```#!`````(````3```$Z```!/X````"K
  471. XM````%```!!H```1"`````0```!4```3(`````0```!8```32`````@```!<`@
  472. XM``-X```#U`````$````8```$9@````$````9```$C`````$````:```$G@``\
  473. XM``````/R```#Z0````=(YR`"3.\`!@`,+'D````(3J[_XDS?0`1.=4YQ```#$
  474. XM[`````$````"````#`````````/R```#Z0````4O#B(O``@L>0````A.KO_<[
  475. XM+%].=0```^P````!`````@````@````````#\@```^D````'2.<P`DSO``X`:
  476. XM$"QY````"$ZN_]9,WT`,3G5.<0```^P````!`````@````P````````#\@``Z
  477. XM`^D````'2.<P`DSO``X`$"QY````"$ZN_]!,WT`,3G5.<0```^P````!````.
  478. XM`@````P````````#\@```^D````$+PXL>0````A.KO_*+%].=0```^P````!@
  479. XM`````@````0````````#\@```^D````$+PXL>0````A.KO_$+%].=0```^P`1
  480. XM```!`````@````0````````#\@```^D````$+PXL>0````A.KO]\+%].=0``;
  481. XM`^P````!`````@````0````````#\@```^D````%+PXB+P`(+'D````(3J[_:
  482. XM*"Q?3G4```/L`````0````(````(`````````_(```/I````!TCG`08N+P`0[
  483. XM*F\`%"QY````!$ZN_Y1,WV"`3G4```/L`````0````(````.`````````_(`H
  484. XM``/I````!B\.3.\``P`(+'D````$3J[_.BQ?3G5.<0```^P````!`````@``2
  485. XM``H````````#\@```^D````&+PXB;P`(("\`#"QY````!$ZN_RXL7TYU```#%
  486. XM[`````$````"````#`````````/R```#Z0````8O#DSO``,`""QY````!$ZN*
  487. XM_LXL7TYU3G$```/L`````0````(````*`````````_(```/I````!2\.("\`'
  488. XM""QY````!$ZN_L(L7TYU```#[`````$````"````"`````````/R```#Z0``6
  489. XM``4O#B!O``@L>0````1.KOZ,+%].=0```^P````!`````@````@````````#3
  490. XM\@```^D````%+PXB;P`(+'D````$3J[^ABQ?3G4```/L`````0````(````(J
  491. XM`````````_(```/I````!2\.(F\`""QY````!$ZN_F(L7TYU```#[`````$`_
  492. XM```"````"`````````/R```#Z0````8O#B)O``@@+P`,+'D````$3J[]V"Q?G
  493. XM3G4```/L`````0````(````,`````````_(```/I````!2\.(&\`""QY```!A
  494. XMN$ZN_\HL7TYU```#[`````$````"````"`````````/R```#Z0````4O#B!OW
  495. XM``@L>0```;A.KO^X+%].=0```^P````!`````@````@````````#\@```^D`"
  496. XM```&+PX@;P`(("\`#"QY```!N$ZN_W`L7TYU```#[`````$````"````#```*
  497. XM``````/R```#Z0````4O#B!O``@L>0```;A.KO\T+%].=0```^P````!````%
  498. XM`@````@````````#\@```^D````'+PY,[P,```A,[P`#`!`L>0```;A.KO\H$
  499. XM+%].=0```^P````!`````@```!`````````#\@```^D````&+PY,[P,```@LF
  500. XG>0```;A.KO[X+%].=4YQ```#[`````$````"````"@````````/RB
  501. X``
  502. Xend
  503. Xsize 11604
  504. END_OF_FILE
  505. if test 16283 -ne `wc -c <'TestMenu.uu'`; then
  506.     echo shar: \"'TestMenu.uu'\" unpacked with wrong size!
  507. fi
  508. # end of 'TestMenu.uu'
  509. fi
  510. if test -f 'makefile' -a "${1}" != "-c" ; then 
  511.   echo shar: Will not clobber existing file \"'makefile'\"
  512. else
  513. echo shar: Extracting \"'makefile'\" \(339 characters\)
  514. sed "s/^X//" >'makefile' <<'END_OF_FILE'
  515. X# Makefile for MakeMenu using PDC
  516. X
  517. XCC = ccx
  518. XCFLAGS = -c
  519. X
  520. X.c.o:
  521. X    $(CC) $(CFLAGS) $*.c
  522. X
  523. Xall : MakeMenu TestMenu
  524. X    TestMenu
  525. X
  526. XBOBJS = makemenu.o
  527. X
  528. XMakeMenu : $(BOBJS)
  529. X    $(CC) -o MakeMenu $(BOBJS)
  530. X
  531. XTOBJS = testmenu.o menu.o
  532. X
  533. XTestMenu : $(TOBJS)
  534. X    $(CC) -o TestMenu $(TOBJS)
  535. X    
  536. Xmenu.o : menu.c
  537. X
  538. Xmenu.c : menu.test MakeMenu
  539. X    MakeMenu menu.test menu.c
  540. END_OF_FILE
  541. if test 339 -ne `wc -c <'makefile'`; then
  542.     echo shar: \"'makefile'\" unpacked with wrong size!
  543. fi
  544. chmod +x 'makefile'
  545. # end of 'makefile'
  546. fi
  547. if test -f 'makemenu.c' -a "${1}" != "-c" ; then 
  548.   echo shar: Will not clobber existing file \"'makemenu.c'\"
  549. else
  550. echo shar: Extracting \"'makemenu.c'\" \(14632 characters\)
  551. sed "s/^X//" >'makemenu.c' <<'END_OF_FILE'
  552. X/* MakeMenu V1.0 (14-oct-90) - by Hans Jansen
  553. X *
  554. X * This program will generate C source to build Intuition menus, from
  555. X * a simple description file. See MakeMenu.Doc for details on usage.
  556. X *
  557. X */
  558. X
  559. X#define  DISABLE      0
  560. X#define  DEFAULT      1
  561. X#define  ENABLE          1
  562. X#define  TOGGLE          2
  563. X#define  CHECK          4
  564. X#define  SELECT          8
  565. X
  566. X#define  CHAR_WIDTH      8
  567. X
  568. X#include <intuition/intuition.h>
  569. X#include <stdio.h>
  570. X
  571. X#define NO_ERROR      0
  572. X#define ERROR_NO_COMMA      1
  573. X#define ERROR_BAD_TEXT      2
  574. X#define ERROR_NO_MENU      3
  575. X#define ERROR_NO_ITEM      4
  576. X#define ERROR_NO_DATA      5
  577. X#define ERROR_BAD_NUMBER  6
  578. X#define ERROR_BAD_COMMAND 7
  579. X#define MAX_LINE    132
  580. X
  581. Xchar cline[MAX_LINE];            /* input line            */
  582. Xchar RecBuf[BUFSIZ];            /* input buffer            */
  583. Xchar *ifname, *ofname;            /* File name pointers        */
  584. XFILE *ofile;                /* output file handle        */
  585. Xint  EndOfFile;                /* true = end of file        */
  586. Xint  lcnt;                /* current input line count    */
  587. X
  588. Xstruct IntuiText *CText;        /* Current Text Item pointer    */
  589. Xstruct IntuiText *AllText;        /* All text items        */
  590. Xstruct MenuItem  *CItem;        /* Current Menu Item        */
  591. Xstruct MenuItem  *CSItem;        /* Current Sub Menu Item    */
  592. Xstruct Menu      *CMenu, *AllMenu;    /* Menu pointers        */
  593. X
  594. Xmain (argc, argv)
  595. X  int   argc;                /*number of arguments        */
  596. X  char  *argv[];            /*array of ptrs to arg strings    */
  597. X
  598. X{
  599. X  FILE    *ifile;                /* input File pointer        */
  600. X  int    i, j;
  601. X  int    result, error;
  602. X  char    *Scan();
  603. X  int    GetLine();
  604. X  char    *cptr;
  605. X  char  etype[5];
  606. X
  607. X/* get the file names and open the files  */
  608. X/* initialize input buffers and variables */
  609. X
  610. X  AllText = NULL;
  611. X  CText   = NULL;
  612. X  CMenu   = NULL;
  613. X  CItem   = NULL;
  614. X  CSItem  = NULL;
  615. X  AllMenu = NULL;
  616. X  result  = NO_ERROR;
  617. X  error   = 0;
  618. X  lcnt    = 0;
  619. X
  620. X  if (argc != 3)
  621. X      printf ("usage: MakeMenu <inputfile> <outputfile>\n");
  622. X
  623. X  for (ifname = NULL, i=1; i<argc && ifname == NULL; i++)
  624. X    if ( *argv[i] != '-') ifname = argv[i];
  625. X
  626. X  for (ofname = NULL, i=i; i<argc && ofname == NULL; i++)
  627. X    if ( *argv[i] != '-') ofname = argv[i];
  628. X
  629. X  EndOfFile = FALSE; /* no end of file  */
  630. X  ifile      = fopen (ifname, "r");  /* open file for reading */
  631. X  if (ifile == NULL) {
  632. X    printf (" Cannot open file %s for input!\n", ifname);
  633. X    exit (10);
  634. X  };
  635. X
  636. X  while ((j = GetLine (ifile, cline, sizeof (cline))) > 0) {
  637. X    cptr = &cline[0];
  638. X    for (i = 0; i < sizeof (etype) -1; i++)
  639. X      etype[i] = toupper (*(cptr + i));
  640. X    etype[i] = '\0';
  641. X    cptr = Scan (cptr, ',', TRUE);
  642. X    if (strcmp ("MENU", etype) == 0)
  643. X      result = Process_Menu (cptr);        /* do a Menu */
  644. X    else if (strcmp ("ITEM", etype) == 0)
  645. X      result = Process_Item (cptr, 0);        /* do an Item */
  646. X    else if (strcmp ("SUBI", etype) == 0)
  647. X      result = Process_Item (cptr, 1);        /* do a SubItem */
  648. X    else
  649. X    result = ERROR_BAD_COMMAND;
  650. X    if (result != NO_ERROR) {
  651. X      error++;
  652. X      printf (" Line %d has syntax error:%s\n", lcnt, cline);
  653. X    };
  654. X  };
  655. X  fclose (ifile);
  656. X  if (error == 0) Do_Output ();
  657. X}
  658. X
  659. Xchar *Scan (ptr, c, control)
  660. X  char *ptr;
  661. X  char c;
  662. X  int control;
  663. X
  664. X{
  665. X  while (*ptr != NULL && ((control && *ptr != c) || (! control && *ptr == c)))
  666. X     ptr++;
  667. X  return (ptr);  /* return the new pointer */
  668. X}
  669. X
  670. XGetLine (fptr, line, lsize)    /* get a line from buffer    */
  671. X  FILE *fptr;            /* pointer to file to read from */
  672. X  char line[];            /* destination of characters    */
  673. X  int  lsize;            /* maximum size for destination    */
  674. X
  675. X{
  676. X    lcnt++;         /* bump line count */
  677. X
  678. X    if (fgets (line, lsize, fptr) == NULL) {
  679. X       EndOfFile = TRUE;
  680. X       return (0);
  681. X    }
  682. X    else {
  683. X       line[strlen (line) - 1] = '\0';        /* discard newline character */
  684. X       return (strlen (line));
  685. X    }
  686. X}
  687. X
  688. Xint Process_Menu (ptr)
  689. X  char *ptr;
  690. X  
  691. X{
  692. X  char *tptr;
  693. X  int len;
  694. X  struct Menu *last;
  695. X
  696. X  if (AllMenu == NULL) {    /* first menu item */
  697. X    AllMenu = (struct Menu *) malloc (sizeof (struct Menu));
  698. X    CMenu = AllMenu;        /* Set current pointer */
  699. X  }
  700. X  else {            /* add new one to list */
  701. X    last = CMenu;
  702. X    CMenu = (struct Menu *) malloc (sizeof(struct Menu));
  703. X    last->NextMenu = CMenu;
  704. X  };
  705. X
  706. X/* Build Menu structure */
  707. X
  708. X  if (*ptr != ',') return (ERROR_NO_COMMA);
  709. X  ptr++;
  710. X
  711. X/* process disable-flag, if any */
  712. X
  713. X  if (*ptr == 'D' || *ptr == 'd')
  714. X      CMenu->Flags = DISABLE;
  715. X  else
  716. X      CMenu->Flags = ENABLE;
  717. X  ptr = Scan (ptr, ',', TRUE);
  718. X  if (*ptr != ',') return (ERROR_NO_COMMA);
  719. X  ptr++;
  720. X
  721. X  tptr = Scan (ptr, '\0', TRUE); /* find end of string */
  722. X  len  = tptr-ptr;
  723. X  CMenu->MenuName = (BYTE *) malloc (len+1);
  724. X  strcpy (CMenu->MenuName, ptr);
  725. X  CMenu->NextMenu = NULL;
  726. X  CMenu->FirstItem = NULL;
  727. X  CItem = NULL;
  728. X  CMenu->Width = len + 3 ;
  729. X  return (NO_ERROR);
  730. X}
  731. X
  732. Xint Process_Item (ptr, type)
  733. X  char *ptr;
  734. X  int type;    /* 0 = Item, 1 = SubItem */
  735. X
  736. X{
  737. X  struct IntuiText *Process_Text();
  738. X  struct MenuItem  *ThisItem;
  739. X  struct MenuItem  *lastI;
  740. X  struct MenuItem  *lastSI;
  741. X
  742. X  if (CMenu == NULL)               return(ERROR_NO_MENU);
  743. X  if (type  == 1 && CItem == NULL) return(ERROR_NO_ITEM);
  744. X  if (*ptr  != ',')                return(ERROR_NO_COMMA);
  745. X
  746. X  if (type  == 0) {            /* Build a MenuItem */
  747. X    lastI  = CItem;
  748. X    CSItem = NULL;  /* clear current Sub Item Flag */
  749. X    CItem  = (struct MenuItem *) malloc (sizeof (struct MenuItem));
  750. X
  751. X    if (lastI == NULL)            /* First Item for Menu */
  752. X      CMenu->FirstItem = CItem;        /* link it to the menu */
  753. X    else
  754. X      lastI->NextItem = CItem;        /* link it to the item list */
  755. X    ThisItem = CItem;            /* build it */
  756. X  }
  757. X  else {                /* Build a SubItem */
  758. X    lastSI = CSItem;
  759. X    CSItem = (struct MenuItem *) malloc (sizeof (struct MenuItem));
  760. X    if (lastSI == NULL)            /* First Sub Item for Menu Item */
  761. X      CItem->SubItem = CSItem;        /* link in the sub items */
  762. X    else
  763. X      lastSI->NextItem = CSItem;
  764. X    ThisItem = CSItem;
  765. X  };
  766. X
  767. X/* Process flags, name, select and command */
  768. X
  769. X  ptr++;
  770. X  ThisItem->Flags = ENABLE;
  771. X  while (*ptr != ',') {
  772. X      if (*ptr == 'D' || *ptr == 'd') ThisItem->Flags &= ~ENABLE;
  773. X      else if (*ptr == 'T' || *ptr == 't') ThisItem->Flags |= TOGGLE;
  774. X      else if (*ptr == 'C' || *ptr == 'c') ThisItem->Flags |= CHECK;
  775. X      else if (*ptr == 'S' || *ptr == 's') ThisItem->Flags |= SELECT;
  776. X      ptr++;
  777. X  }
  778. X
  779. X  ptr++;
  780. X   
  781. X  ThisItem->ItemFill = (APTR) Process_Text (ptr);
  782. X  if (ThisItem->ItemFill == NULL) return (ERROR_BAD_TEXT);
  783. X
  784. X  ptr = Scan (ptr, ',', TRUE); /* find next comma */
  785. X  if (*ptr != ',') return (ERROR_NO_COMMA);
  786. X  ptr++;
  787. X
  788. X/* Select name? */
  789. X
  790. X  ThisItem->SelectFill = (APTR) Process_Text (ptr);
  791. X
  792. X  ptr = Scan (ptr, ',', TRUE); /* find next comma */
  793. X  if (*ptr != ',') return (ERROR_NO_COMMA);
  794. X  ptr++;
  795. X
  796. X/* Command ? */
  797. X  ThisItem->NextItem      = NULL;
  798. X  ThisItem->SubItem       = NULL;
  799. X  ThisItem->Command       = *ptr;
  800. X  ThisItem->MutualExclude = 0L;
  801. X  return (NO_ERROR);
  802. X}
  803. X
  804. Xstruct IntuiText *Process_Text (ptr)
  805. X  char *ptr;
  806. X{
  807. X  
  808. X  struct IntuiText *dptr, *lasText;
  809. X  char *tptr;
  810. X
  811. X  if (*ptr == ',') return (NULL);
  812. X
  813. X  lasText = AllText;
  814. X  while (lasText != NULL) {     /* search end of saved-texts list */
  815. X    CText = lasText;
  816. X    lasText = lasText->NextText;
  817. X  };
  818. X  lasText = CText;
  819. X  CText = (struct IntuiText *) malloc (sizeof (struct IntuiText));
  820. X  CText->NextText = NULL;
  821. X  if( AllText == NULL )
  822. X    AllText = CText;
  823. X  else
  824. X    lasText->NextText = CText;
  825. X
  826. X  tptr = Scan (ptr, ',', TRUE);
  827. X  CText->IText = (UBYTE *) malloc (tptr-ptr+1);
  828. X  strncpy (CText->IText, ptr, tptr-ptr);
  829. X  if (CMenu->Width <= tptr-ptr) CMenu->Width = tptr-ptr;
  830. X
  831. X/* check for duplicate, eliminate this one if duplicate */
  832. X  
  833. X  dptr = AllText;
  834. X  while (dptr != CText) {
  835. X    if (strcmp (dptr->IText, CText->IText) == 0 ) {
  836. X      free ((char *) (CText->IText));
  837. X      free ((char *) CText);
  838. X      CText = dptr;
  839. X      lasText->NextText = NULL;
  840. X    }
  841. X    else dptr = dptr->NextText;
  842. X  }
  843. X  return (CText);
  844. X}
  845. X
  846. XDo_Output()
  847. X
  848. X{
  849. X  char nxt, quote, Flag[10];
  850. X  char Mptr[14];
  851. X  int Menu, Item, left, top, width, height;
  852. X  int stop;
  853. X  char rest[60];
  854. X
  855. X  ofile = fopen (ofname, "w");  /* open file for writing */
  856. X  if (ofile == NULL) {
  857. X    printf (" Cannot open file %s for output!\n", ofname);
  858. X    exit (10);
  859. X  }
  860. X
  861. X/* Output the IntuiText structure first */
  862. X
  863. X  quote = '"';
  864. X  fprintf (ofile, "/*****************************************/\n");
  865. X  fprintf (ofile, "/*      This code was generated by:      */\n");
  866. X  fprintf (ofile, "/* MakeMenu V1.0 (Hans Jansen  7-oct-90) */\n");
  867. X  fprintf (ofile, "/*****************************************/\n");
  868. X  fprintf (ofile, "#include <exec/types.h>\n");
  869. X  fprintf (ofile, "#include <intuition/intuition.h>\n");
  870. X
  871. X  CText = AllText;
  872. X  if (AllText != NULL) {
  873. X    fprintf (ofile, "\nstruct IntuiText IText[] =\n");
  874. X    fprintf (ofile, "  {\n");
  875. X  };
  876. X
  877. X  while (CText != NULL) {         /* for all text to output */
  878. X    if (CText->NextText == NULL) nxt = ' ';
  879. X    else nxt = ',';
  880. X    fprintf (ofile, "    { 0, 1, JAM2, CHECKWIDTH, 0, NULL, %c%s%c, NULL }%c\n",
  881. X      quote, CText->IText, quote, nxt);
  882. X    CText = CText->NextText;
  883. X  };
  884. X
  885. X  if (AllText != NULL) fprintf (ofile,"  };\n\n");
  886. X
  887. X  CMenu = AllMenu;
  888. X  Menu = 0;
  889. X  left = 0;
  890. X  Item = 0;
  891. X  height = 10;
  892. X
  893. X  while (CMenu != NULL) {         /* first output the subitems, if any */
  894. X    Item = 0;
  895. X    CItem = CMenu->FirstItem;
  896. X    while (CItem != NULL) {
  897. X      CSItem = CItem->SubItem;
  898. X      if (CSItem != NULL) Do_Out_Sub (Menu,Item);
  899. X      Item++;
  900. X      CItem = CItem->NextItem;
  901. X    };
  902. X    Menu++;
  903. X    CMenu = CMenu->NextMenu;
  904. X  }
  905. X
  906. X  CMenu = AllMenu;
  907. X  Menu = 0;
  908. X  left = 0;
  909. X  Item = 0;
  910. X  height = 10;
  911. X
  912. X  while (CMenu != NULL) {           /* now output the items */
  913. X    Item = 0;
  914. X    CItem = CMenu->FirstItem;
  915. X    CSItem = CItem->SubItem;
  916. X    top  = 0;
  917. X    fprintf (ofile, "struct MenuItem M%d[] = \n",Menu);
  918. X    fprintf (ofile, "  {\n");
  919. X    top  = 0;
  920. X    width =  CMenu->Width * CHAR_WIDTH;
  921. X
  922. X    while (CItem != NULL) {
  923. X      Item++;
  924. X      CSItem = CItem->SubItem;
  925. X
  926. X      if (CItem->NextItem == NULL) fprintf (ofile, "    {NULL, ");
  927. X      else fprintf (ofile, "    {&M%d[%2d], ", Menu, Item);
  928. X      fprintf (ofile, "%3d, %3d, %3d+CHECKWIDTH, %3d,\n",
  929. X            left, top, width, height);
  930. X      fprintf (ofile, "      ITEMTEXT|HIGHCOMP");
  931. X      if ((CItem->Flags & ENABLE) == ENABLE) fprintf (ofile, "|ITEMENABLED");
  932. X      if ((CItem->Flags & TOGGLE) == TOGGLE) fprintf (ofile, "|MENUTOGGLE");
  933. X      if ((CItem->Flags & CHECK)  == CHECK)  fprintf (ofile, "|CHECKIT");
  934. X      if ((CItem->Flags & SELECT) == SELECT) fprintf (ofile, "|CHECKED");
  935. X      if (CItem->Command != NULL && CItem->Command != ' ')
  936. X          fprintf (ofile, "|COMMSEQ");
  937. X      fprintf (ofile, ",\n      0, (APTR)&IText[%2d], ",
  938. X            Index(CItem->ItemFill));
  939. X      if (CItem->SelectFill == NULL) fprintf (ofile, "NULL, ");
  940. X      else fprintf (ofile, "(APTR)&IText[%2d], ", Index(CItem->SelectFill));
  941. X      if (CItem->Command == NULL || CItem->Command == ' ')
  942. X          fprintf (ofile, "NULL, ");
  943. X      else fprintf (ofile, "'%c', ", CItem->Command);
  944. X      if (CSItem == NULL) fprintf (ofile, "NULL, MENUNULL}");
  945. X      else fprintf (ofile, "&M%dI%d[0], MENUNULL}", Menu, (Item-1));
  946. X      if (CItem->NextItem == NULL) fprintf (ofile, "\n");
  947. X      else fprintf (ofile, ",\n");
  948. X
  949. X      CItem = CItem->NextItem;
  950. X      top   = top + height;
  951. X    };
  952. X    fprintf (ofile, "  };\n\n");
  953. X    CMenu = CMenu->NextMenu;
  954. X    Menu++;
  955. X  };
  956. X
  957. X  CMenu = AllMenu;
  958. X  fprintf (ofile, "struct Menu TheMenu[] =\n");
  959. X  fprintf (ofile, "  {\n");
  960. X  left = 0;
  961. X  top  = 0;
  962. X  Menu = 0;
  963. X  
  964. X  while (CMenu != NULL) {           /* finally, the menus themselves */
  965. X    Menu++;
  966. X    width = CMenu->Width * CHAR_WIDTH;
  967. X    if (CMenu->NextMenu == NULL) {    /* the NextMenu pointer */
  968. X      sprintf (Mptr, "NULL       ");
  969. X      nxt = ' ';
  970. X    }
  971. X    else {
  972. X      sprintf (Mptr, "&TheMenu[%2d]", Menu);
  973. X      nxt = ',';
  974. X    };
  975. X    (void) strncpy (rest, "                               ", 25);
  976. X    stop = CMenu->Width - strlen (CMenu->MenuName);    /* the name string */
  977. X    if (stop <= 0)
  978. X      (void) strncpy (rest, CMenu->MenuName, 25);
  979. X    else {
  980. X      stop = stop / 2;
  981. X      (void) strncpy (&rest[stop], CMenu->MenuName, 25-stop);
  982. X      (void) strncat (rest, "                         ", 25);
  983. X    };
  984. X
  985. X    quote = '"';
  986. X    height = 10;
  987. X    fprintf (ofile, "    {%12s, %3d, %3d, %3d+CHECKWIDTH, %3d,\n",
  988. X            Mptr, left, top, width, height);
  989. X    if ((CMenu->Flags & ENABLE) == ENABLE)
  990. X        fprintf (ofile, "MENUENABLED");
  991. X    else
  992. X        fprintf (ofile, "0");
  993. X    fprintf (ofile, ",%c%s%c, &M%d[0]}%c\n",
  994. X            quote, rest, quote, (Menu-1), nxt);
  995. X    left = left + width + 4*CHAR_WIDTH;
  996. X    CMenu = CMenu->NextMenu;
  997. X  };
  998. X  fprintf (ofile, "  };\n\n");
  999. X  fprintf (ofile, "struct Menu *MyMenu = &TheMenu[0];\n\n");
  1000. X
  1001. X  fprintf (ofile, "/*****************************************/\n");
  1002. X  fprintf (ofile, "/*         End of generated code         */\n");
  1003. X  fprintf (ofile, "/*****************************************/\n");
  1004. X
  1005. X  fclose (ofile);
  1006. X}
  1007. X
  1008. Xint Index (ptr)   /* Find the position index */
  1009. X  struct IntuiText *ptr;
  1010. X {
  1011. X  int idx;
  1012. X
  1013. X  idx = 0;
  1014. X  CText = AllText;
  1015. X
  1016. X  while (CText != NULL && ptr != CText) {
  1017. X    idx++;
  1018. X    CText = CText->NextText;
  1019. X  };
  1020. X  return (idx);
  1021. X}
  1022. X
  1023. XDo_Out_Sub (Menu, Item)           /* output an item's SubItems */
  1024. X  int Menu, Item;
  1025. X{ 
  1026. X  int SItem;
  1027. X  int stop, width, sleft;
  1028. X  int top, height;
  1029. X  char Mptr[14];
  1030. X  char rest[60];
  1031. X  char nxt, Flag[10];
  1032. X
  1033. X  SItem = 0;
  1034. X  top = 0;
  1035. X  height = 10;
  1036. X  fprintf (ofile, "struct MenuItem M%dI%d[] = \n", Menu, Item);
  1037. X  fprintf (ofile, "  {\n");
  1038. X  width = CMenu->Width*CHAR_WIDTH;
  1039. X  SItem = 0;
  1040. X  while (CSItem != NULL) {
  1041. X    SItem++;
  1042. X    sleft =  (width * 7) / 10;
  1043. X    stop  =  top + 2;
  1044. X    if (CSItem->NextItem == NULL) fprintf (ofile, "    {NULL, ");
  1045. X    else fprintf (ofile, "    {&M%dI%d[%2d], ", Menu, Item, SItem);
  1046. X    fprintf (ofile, "%3d, %3d, %3d+CHECKWIDTH, %3d,\n",
  1047. X            sleft, stop, width, height);
  1048. X    fprintf (ofile, "      ITEMTEXT|HIGHCOMP");
  1049. X    if ((CSItem->Flags & ENABLE) == ENABLE) fprintf (ofile, "|ITEMENABLED");
  1050. X    if ((CSItem->Flags & TOGGLE) == TOGGLE) fprintf (ofile, "|MENUTOGGLE");
  1051. X    if ((CSItem->Flags & CHECK)  == CHECK)  fprintf (ofile, "|CHECKIT");
  1052. X    if ((CSItem->Flags & SELECT) == SELECT) fprintf (ofile, "|CHECKED");
  1053. X    if (CSItem->Command != NULL && CSItem->Command != ' ')
  1054. X        fprintf (ofile, "|COMMSEQ");
  1055. X    fprintf (ofile, ",\n      0, (APTR)&IText[%2d], ",
  1056. X            Index(CSItem->ItemFill));
  1057. X    if (CSItem->SelectFill == NULL) fprintf (ofile, "NULL, ");
  1058. X    else fprintf (ofile, "(APTR)&IText[%2d], ", Index(CSItem->SelectFill));
  1059. X    if (CSItem->Command == NULL || CSItem->Command == ' ')
  1060. X        fprintf (ofile, "NULL, ");
  1061. X    else fprintf (ofile, "'%c', ", CSItem->Command);
  1062. X    fprintf (ofile, "NULL, MENUNULL}");
  1063. X    if (CSItem->NextItem == NULL) fprintf (ofile, "\n");
  1064. X    else fprintf (ofile, ",\n");
  1065. X
  1066. X    CSItem = CSItem->NextItem;
  1067. X    top = top + height;
  1068. X  };
  1069. X  fprintf (ofile,"  };\n\n");
  1070. X}
  1071. END_OF_FILE
  1072. if test 14632 -ne `wc -c <'makemenu.c'`; then
  1073.     echo shar: \"'makemenu.c'\" unpacked with wrong size!
  1074. fi
  1075. chmod +x 'makemenu.c'
  1076. # end of 'makemenu.c'
  1077. fi
  1078. if test -f 'makemenu.o.uu' -a "${1}" != "-c" ; then 
  1079.   echo shar: Will not clobber existing file \"'makemenu.o.uu'\"
  1080. else
  1081. echo shar: Extracting \"'makemenu.o.uu'\" \(9842 characters\)
  1082. sed "s/^X//" >'makemenu.o.uu' <<'END_OF_FILE'
  1083. Xbegin 700 makemenu.o
  1084. XM```#YP````````/H`````3,```````/K```!+````^\!```"7V-L:6YE````#
  1085. XM`````0```E]296-"=68`````A`$```)?:69N86UE````!(0!```"7V]F;F%MJ
  1086. XM90````2(`0```E]O9FEL90`````$C`$```-?16YD3V9&:6QE``````20`0``V
  1087. XM`E]L8VYT```````$E`$```)?0U1E>'0`````!)@!```"7T%L;%1E>'0```2<0
  1088. XM`0```E]#271E;0`````$H`$```)?0U-)=&5M````!*0!```"7T--96YU````!
  1089. XM``2H`0```E]!;&Q-96YU```$K`````````/R```#Z`````$Q```````#Z0``J
  1090. XM!6E.5?_B2.<?."XM``PD;0`(2?D```2$<``CP```!)QP`"/````$F'``(\``W
  1091. XM``2H<``CP```!*!P`"/````$I'``(\````2L<``J`'``)D!P`"/````$E"`*F
  1092. XM#(`````#9PY(>0``%7A.N0````!83W``*(!P`28`MHIL)"`49B`@1R`#Y8#1Y
  1093. XMP"!0$!`,```M9PH@1R`#Y8#1P"B04H-@V'``(\````2()@.VBFPL(#D```2($
  1094. XM9B0@1R`#Y8#1P"!0$!`,```M9PX@1R`#Y8#1P"/0```$B%*#8-!P`"/````$C
  1095. XMD$AY```5=B\43KD`````4$\L`&8<+Q1(>0``%51.N0````!03TAX``I.N0``7
  1096. XM``!83TAX`(1(>0`````O!DZY```"A-[\``PK0/_T("W_]&\``/!!^0`````HS
  1097. XM"'``)@`,@P````1L("!$T<,0$$B`2,`O`$ZY`````%A/0>W_X]'#$(!2@V#8#
  1098. XM0>W_X]'#0A!(>``!2'@`+"\$3KD```(\WOP`#"@`2&W_XTAY```53DZY````K
  1099. XM`%!/2H!F#B\$3KD```+>6$\J`&!22&W_XTAY```52$ZY`````%!/2H!F$$*G^
  1100. XM+P1.N0```^103RH`8"Q(;?_C2'D``!5"3KD`````4$]*@&822'@``2\$3KD`(
  1101. XM``/D4$\J`&`$<`<J`$J%9QY22TAY`````"\Y```$E$AY```5)$ZY`````-[\"
  1102. XM``Q@`/[R+P9.N0````!83R`+9@9.N0``!LY,WQSX3EU.=4Y5``!(YQP`)BT`?
  1103. XM""@M``PJ+0`0($,0$&<D2H5G#"!#$!!(@$C`L(1F$$J%9A`@0Q`02(!(P+"$I
  1104. XM9@12@V#6(`-,WP`X3EU.=4Y5```O`R8M``Q2N0``!)0O+0`(+RT`$"\#3KD`)
  1105. XM````WOP`#$J`9A!P`2/````$D'``)A].74YU+P-.N0````!83R!#T<`@"$(H7
  1106. XM__\O`TZY`````%A/8-I@V$Y5__1(YQXX)BT`"$7Y```$J$?Y`````$GY```$V
  1107. XMK"`49@Y(>``>3I-83RB`))1@$"P22'@`'DZ36$\D@"!&()(@0Q`0#```+&<*6
  1108. XM<`%,WQQX3EU.=5*#($,0$`P``$1G"B!#$!`,``!D9A!P`'(`$@`@`2!2,4``8
  1109. XM#&`.<`%R`!(`(`$@4C%```Q(>``!2'@`+"\#3KK^RM[\``PF`"!#$!`,```LU
  1110. XM9P1P`6"B4H-(>``!0J<O`TZZ_JC>_``,*@"0@R@`4H`O`$Z36$\@4B%```XOA
  1111. XM`R!2+R@`#DZY`````%!/<``@4B"`<``@4B%``!)P`"/````$H"`$5H`@4C%`K
  1112. XM``AP`&``_TA.5?_T2.<?,"8M``A%^0``!*!'^0``!*0N+0`,(#D```2H9@IPD
  1113. XM`TS?#/A.74YU#(<````!9@@@$F8$<`1@Z"!#$!`,```L9P1P`6#:2H=F+"P2L
  1114. XM<``F@$AX`").N0````!83R2`2H9F#"!Y```$J"%2`!)@!"!&()(H$F`B*A-(3
  1115. XM>``B3KD`````6$\F@$J%9@@@4B%3`!Q@!"!%(),H$U*#<`%R`!(`(`$@1#%`D
  1116. XM``P@0Q`0#```+&<``'X@0Q`0#```1&<*($,0$`P``&1F"B!$`FC__@`,8%@@"
  1117. XM0Q`0#```5&<*($,0$`P``'1F"B!$`&@``@`,8#H@0Q`0#```0V<*($,0$`P`M
  1118. XM`&-F"B!$`&@`!``,8!P@0Q`0#```4V<*($,0$`P``'-F""!$`&@`"``,4H-@#
  1119. XM`/]Z4H,O`TZY```%NEA/($0A0``2($0@*``29@9P`F``_M)(>``!2'@`+"\#O
  1120. XM3KK\]M[\``PF`"!#$!`,```L9P9P`6``_JY2@R\#3KD```6Z6$\@1"%``!9("
  1121. XM>``!2'@`+"\#3KK\P-[\``PF`"!#$!`,```L9P9P`6``_GA2@W``($0@@'``/
  1122. XM($0A0``<($,B1!-0`!IP`"!$(4``#G``8`#^4DY5__1(YQXP1?D```28*"T`,
  1123. XM"$?Y```$G"!$$!`,```L9@IP`$S?#'A.74YU)A-*@V<*)(,@0R8H`!!@\B82*
  1124. XM2'@`%$ZY`````%A/)(!P`"!2(4``$"`39@0FDF`&($,A4@`02'@``4AX`"POV
  1125. XM!$ZZ_!3>_``,+`"0A%*`+P!.N0````!83R!2(4``#"`&D(0O`"\$(%(O*``,!
  1126. XM3KD`````WOP`#"!Y```$J#`H``A(P"(&DH2P@6X.(`:0A"!Y```$J#%```@JG
  1127. XM$[J29T0@4B\H``P@12\H``Q.N0````!03TJ`9B0@4B\H``Q.N0````!83R\2E
  1128. XM3KD`````6$\DA7``($,A0``08`8@12HH`!!@N"`28`#_$DY5_XY(YQ\X1?D`W
  1129. XM``2,1_D`````2?D```2@0?D```2H*`A(>0``%2(O.0``!(A.N0````!03R2`"
  1130. XM(!)F("\Y```$B$AY```5`$ZY`````%!/2'@`"DZY`````%A/&WP`(O_^2'D`7
  1131. XM`!32+Q).DU!/2'D``!2D+Q).DU!/2'D``!1V+Q).DU!/2'D``!1(+Q).DU!/+
  1132. XM2'D``!0N+Q).DU!/2'D``!0,+Q).DU!/(_D```2<```$F"`Y```$G&<82'D`W
  1133. XM`!/N+Q).DU!/2'D``!/H+Q).DU!/(#D```289V`@>0``!)@@*``09@@;?``@M
  1134. XM__]@!AM\`"S__Q`M__](@$C`+P`0+?_^2(!(P"\`('D```28+R@`#!`M__Y(R
  1135. XM@$C`+P!(>0``$ZXO$DZ3WOP`&"!Y```$F"/H`!````288)@@.0``!)QG#$AY>
  1136. XM```3IB\23I-03R!$(+D```2L<``F`'``+@!P`"H`<`HK0/_.($0@$&="<``J^
  1137. XM`"!$(%`HJ``2(!1G)B!4(^@`'```!*0@.0``!*1G#"\%+P-.N0``#7103U*%2
  1138. XM(%0HD@H,@1"!0(D0BD&"X($0@N0``!*QP`"8`<``N`'``*@!P"BM`_\X@(
  1139. XM1"`09P`"9G``*@`@1"!0**@`$B!4(^@`'```!*1P`"P`+P-(>0``$XPO$DZ3F
  1140. XMWOP`#$AY```3AB\23I-03W``+``@1"!0,"@`"$C`YX`K0/_2(!1G``'\4H4@+
  1141. XM5"/H`!P```2D(%0@$&8.2'D``!-Z+Q).DU!/8!(O!2\#2'D``!-H+Q).D][\:
  1142. XM`!`O+?_.+RW_TB\&+P=(>0``$T@O$DZ3WOP`&$AY```3,"\23I-03R!4,"@`2
  1143. XM#'(`,@`@`0*``````0R``````68,2'D``!,B+Q).DU!/(%0P*``,<@`R`"`!G
  1144. XM`H`````"#(`````"9@Q(>0``$Q8O$DZ34$\@5#`H``QR`#(`(`$"@`````0,>
  1145. XM@`````1F#$AY```3#"\23I-03R!4,"@`#'(`,@`@`0*`````"`R`````"&8,$
  1146. XM2'D``!,"+Q).DU!/(%00*``:9Q@@5!`H`!H,```@9PQ(>0``$O@O$DZ34$\@M
  1147. XM5"\H`!).N0``#3Q83R\`2'D``!+8+Q).D][\``P@5"`H`!9F#DAY```2T"\2`
  1148. XM3I-03V`>(%0O*``63KD```T\6$\O`$AY```2O"\23I/>_``,(%00*``:9PP@U
  1149. XM5!`H`!H,```@9@Y(>0``$K0O$DZ34$]@&B!4$"@`&DB`2,`O`$AY```2K"\2-
  1150. XM3I/>_``,(#D```2D9@Y(>0``$IPO$DZ34$]@%B`%4X`O`"\#2'D``!*&+Q).C
  1151. XMD][\`!`@5"`09@Y(>0``$H0O$DZ34$]@#$AY```2@"\23I-03R!4*)`@!M"M\
  1152. XM_\XL`&``_@)(>0``$G@O$DZ34$\@1"!0(D0BD%*#8`#]EB!$(+D```2L2'D`'
  1153. XM`!)>+Q).DU!/2'D``!)8+Q).DU!/<``N`'``+`!P`"8`($0@$&<``;92@R!$8
  1154. XM(%`P*``(2,#G@"M`_](@1"!0(!!F&DAY```23$AM_^9.N0````!03QM\`"#_4
  1155. XM_V`<+P-(>0``$CY(;?_F3KD`````WOP`#!M\`"S__TAX`!E(>0``$AY(;?^.2
  1156. XM3KD`````WOP`#"!$(%`P*``(2,`O`"!$(%`O*``.3KD`````6$\B`"`?D($K<
  1157. XM0/_*("W_RFX<2'@`&2!$(%`O*``.2&W_CDZY`````-[\``Q@5$AX``(O+?_*%
  1158. XM3KD`````(!]83RM`_\IP&9"M_\HO`"!$(%`O*``.0>W_CB`(T*W_RB\`3KD`W
  1159. XM````WOP`#$AX`!E(>0``$@1(;?^.3KD`````WOP`#!M\`"+__G`**T#_SB\M)
  1160. XM_\XO+?_2+P8O!TAM_^9(>0``$=@O$DZ3WOP`'"!$(%`P*``,<@`R`"`!`H```
  1161. XM```!#(`````!9@Y(>0``$<PO$DZ34$]@#$AY```1RB\23I-03Q`M__](@$C`U
  1162. XM+P`@`U.`+P`0+?_^2(!(P"\`2&W_CA`M__Y(@$C`+P!(>0``$;0O$DZ3WOP`*
  1163. XM'"`'T*W_T@:`````("X`($0@4")$(I!@`/Y&2'D``!&L+Q).DU!/2'D``!&&,
  1164. XM+Q).DU!/2'D``!%8+Q).DU!/2'D``!$J+Q).DU!/2'D``!#\+Q).DU!/+Q).&
  1165. XMN0````!83TS?'/A.74YU3E7__$CG$"!%^0``!)AP`"8`)+D```2<(!)G$B`MO
  1166. XM``BPDF<*4H,@4B2H`!!@ZB`#3-\$"$Y=3G5.5?^22.<?.$7Y```$C$?Y````X
  1167. XM`$GY```$I'``*`!P`"8`<`HL`"\M``PO+0`(2'D``!#>+Q).D][\`!!(>0``&
  1168. XM$-@O$DZ34$\@>0``!*@P*``(2,#G@"H`<``H`"`49P`!]E*$(`4B`-*!T('2D
  1169. XM@="!2'@`"B\`3KD`````(!]83RM`__`@`U2`+@`@5"`09@Y(>0``$,PO$DZ3.
  1170. XM4$]@&"\$+RT`#"\M``A(>0``$+@O$DZ3WOP`%"\&+P4O!R\M__!(>0``$)@OQ
  1171. XM$DZ3WOP`&$AY```0@"\23I-03R!4,"@`#'(`,@`@`0*``````0R``````68,6
  1172. XM2'D``!!R+Q).DU!/(%0P*``,<@`R`"`!`H`````"#(`````"9@Q(>0``$&8O+
  1173. XM$DZ34$\@5#`H``QR`#(`(`$"@`````0,@`````1F#$AY```07"\23I-03R!49
  1174. XM,"@`#'(`,@`@`0*`````"`R`````"&8,2'D``!!2+Q).DU!/(%00*``:9Q@@"
  1175. XM5!`H`!H,```@9PQ(>0``$$@O$DZ34$\@5"\H`!).NOXN6$\O`$AY```0*"\2`
  1176. XM3I/>_``,(%0@*``69@Y(>0``$"`O$DZ34$]@'"!4+R@`%DZZ_?Q83R\`2'D`T
  1177. XM`!`,+Q).D][\``P@5!`H`!IG#"!4$"@`&@P``"!F#DAY```0!"\23I-03V`:3
  1178. XM(%00*``:2(!(P"\`2'D```_\+Q).D][\``Q(>0``#^PO$DZ34$\@5"`09@Y(V
  1179. XM>0``#^HO$DZ34$]@#$AY```/YB\23I-03R!4*)`@`]"&)@!@`/X(2'D```_>U
  1180. XM+Q).DU!/3-\<^$Y=3G4@('T["@H``"P*```*`$Y53$PL($U%3E5.54Q,?0`G5
  1181. XM)6,G+"```$Y53$PL(```*$%05%(I)DE497AT6R4R9%TL(`!.54Q,+"```"P*:
  1182. XM("`@("`@,"P@*$%05%(I)DE497AT6R4R9%TL(```?$-/34U315$``'Q#2$5#W
  1183. XM2T5$``!\0TA%0TM)5```?$U%3E543T='3$4`?$E414U%3D%"3$5$```@("`@4
  1184. XM("!)5$5-5$585'Q(24=(0T]-4``E,V0L("4S9"P@)3-D*T-(14-+5TE$5$@L`
  1185. XM("4S9"P*`"`@("![)DTE9$DE9%LE,F1=+"``("`@('M.54Q,+"``("!["@``A
  1186. XM<W1R=6-T($UE;G5)=&5M($TE9$DE9%M=(#T@"@``+RHJ*BHJ*BHJ*BHJ*BHJK
  1187. XM*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ+PH``"\J("`@("`@("`@16YDW
  1188. XM(&]F(&=E;F5R871E9"!C;V1E("`@("`@("`@*B\*```O*BHJ*BHJ*BHJ*BHJI
  1189. XM*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHO"@``<W1R=6-T($UE;G4@U
  1190. XM*DUY365N=2`]("94:&5-96YU6S!=.PH*```@('T["@H``"PE8R5S)6,L("9-T
  1191. XM)61;,%U])6,*```P`$U%3E5%3D%"3$5$`"`@("![)3$R<RP@)3-D+"`E,V0L"
  1192. XM("4S9"M#2$5#2U=)1%1(+"`E,V0L"@``("`@("`@("`@("`@("`@("`@("`@#
  1193. XM("`@(``@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@`"94:&5-96YU\
  1194. XM6R4R9%T`3E5,3"`@("`@("``("!["@``<W1R=6-T($UE;G4@5&AE365N=5M=[
  1195. XM(#T*```@('T["@H``"P*```*`"9-)61))61;,%TL($U%3E5.54Q,?0!.54Q,=
  1196. XM+"!-14Y53E5,3'T`)R5C)RP@``!.54Q,+"```"A!4%12*29)5&5X=%LE,F1=Q
  1197. XM+"``3E5,3"P@```L"B`@("`@(#`L("A!4%12*29)5&5X=%LE,F1=+"```'Q#?
  1198. XM3TU-4T51``!\0TA%0TM%1```?$-(14-+250``'Q-14Y55$]'1TQ%`'Q)5$5-*
  1199. XM14Y!0DQ%1```("`@("`@251%351%6%1\2$E'2$-/35``)3-D+"`E,V0L("4S2
  1200. XM9"M#2$5#2U=)1%1(+"`E,V0L"@`@("`@>R9-)61;)3)D72P@```@("`@>TY5_
  1201. XM3$PL(``@('L*``!S=')U8W0@365N=4ET96T@325D6UT@/2`*`"`@?3L*"@``3
  1202. XM("`@('L@,"P@,2P@2D%-,BP@0TA%0TM724142"P@,"P@3E5,3"P@)6,E<R5C_
  1203. XM+"!.54Q,('TE8PH``"`@>PH```IS=')U8W0@26YT=6E497AT($E497AT6UT@>
  1204. XM/0H``"-I;F-L=61E(#QI;G1U:71I;VXO:6YT=6ET:6]N+F@^"@`C:6YC;'5D?
  1205. XM92`\97AE8R]T>7!E<RYH/@H``"\J*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJQ
  1206. XM*BHJ*BHJ*BHJ*BHJ*BHJ*B\*```O*B!-86ME365N=2!6,2XP("A(86YS($IA'
  1207. XM;G-E;B`@-RUO8W0M.3`I("HO"@``+RH@("`@("!4:&ES(&-O9&4@=V%S(&=EC
  1208. XM;F5R871E9"!B>3H@("`@("`J+PH``"\J*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ&
  1209. XM*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*B\*```@0V%N;F]T(&]P96X@9FEL92`E<R!FJ
  1210. XM;W(@;W5T<'5T(0H`=P`@3&EN92`E9"!H87,@<WEN=&%X(&5R<F]R.B5S"@!3!
  1211. XM54))``!)5$5-``!-14Y5```@0V%N;F]T(&]P96X@9FEL92`E<R!F;W(@:6YP?
  1212. XM=70A"@``<@!U<V%G93H@36%K94UE;G4@/&EN<'5T9FEL93X@/&]U='!U=&9I.
  1213. XM;&4^"@!.<0```^P````X`````````!(````:````(@```"H````R````.@``C
  1214. XM`$(```!2````H@```*X```#0````W````18```$T```"`@```@@```*0```"^
  1215. XML````NP```+X```#T````_(```/X```$`@``!$X```7$```%S@``!EX```9VO
  1216. XM```&V```!N0```;J```&^```!PP```=Z```'?@``!X0```>D```'K```!]H`9
  1217. XM``?\```(!```"`P```@B```(5```"%H```B$```(M```"/H```J2```+"@``&
  1218. XM#48```U0```-?@``#8H```V^````5@````$```!B````X@```/@```$>```!0
  1219. XM>@```8H```&>```!K@```<0```'4```![````@X```(P```%(```!60```;RB
  1220. XM```'$@``!S(```<^```'2@``!U8```=B```';@``!XP```>8```'[@``"!0`F
  1221. XM``AF```(P```",X```D&```)&```"3(```E````)9@``"8P```FR```)V```@
  1222. XM"?@```H*```*%```"BH```H^```*2```"FH```J$```*F@``"K````K$```*Y
  1223. XMT@``"NX```L0```+'```"U8```MR```+D```#"P```Q<```,A@``#)0```S(K
  1224. XM```,\```#/P```T(```-%```#2````VD```-L@``#@8```X>```.-@``#D0`M
  1225. XM``YJ```.D```#K8```[<```._```#Q8```\L```/2```#VH```^$```/D@``R
  1226. XM#Z0```^R```/S`````````/O`0```E]M86EN``````````$```)?4V-A;@``O
  1227. XM`````CP!```"7T=E=$QI;F4```*$`0``!%]0<F]C97-S7TUE;G4```````+>E
  1228. XM`0``!%]0<F]C97-S7TET96T```````/D`0``!%]0<F]C97-S7U1E>'0`````?
  1229. XM``6Z`0```U]$;U]/=71P=70`````!LX!```"7TEN9&5X``````T\`0```U]$C
  1230. XM;U]/=71?4W5B````#72!```"7W!R:6YT9@`````$````:````/X```(4```',
  1231. XM&($```)?9F]P96X```````(```#J```&_H$```)?97AI=`````````(```$*K
  1232. XM```')($```)?=&]U<'!E<@````$```%4@0```E]S=')C;7``````!````9``"
  1233. XM``&T```!V@``!I*!```"7V9C;&]S90`````"```")```#2Z!```"7V9G971SD
  1234. XM```````!```"H($```)?<W1R;&5N``````,```+````"U```"[B!```"7VUAK
  1235. XM;&QO8P`````%```"\@``!$````1H```%_@``!CB!```"7W-T<F-P>0`````!<
  1236. XM```#N($```)?<W1R;F-P>0````0```94```+F@``"^````P>@0```E]F<F5E,
  1237. XM`````````@``!J0```:N@0```E]F<')I;G1F`````@``!MX```V$@0```E]S'
  1238. XM<')I;G1F`````@``"V````M\@0```BYL9&EV<P```````@``"_0```WL@0``5
  1239. X9`E]S=')N8V%T`````0``##8````````#\FEVW
  1240. X``
  1241. Xend
  1242. Xsize 7000
  1243. END_OF_FILE
  1244. if test 9842 -ne `wc -c <'makemenu.o.uu'`; then
  1245.     echo shar: \"'makemenu.o.uu'\" unpacked with wrong size!
  1246. fi
  1247. # end of 'makemenu.o.uu'
  1248. fi
  1249. if test -f 'menu.c' -a "${1}" != "-c" ; then 
  1250.   echo shar: Will not clobber existing file \"'menu.c'\"
  1251. else
  1252. echo shar: Extracting \"'menu.c'\" \(4525 characters\)
  1253. sed "s/^X//" >'menu.c' <<'END_OF_FILE'
  1254. X/*****************************************/
  1255. X/*      This code was generated by:      */
  1256. X/* MakeMenu V1.0 (Hans Jansen  7-oct-90) */
  1257. X/*****************************************/
  1258. X#include <exec/types.h>
  1259. X#include <intuition/intuition.h>
  1260. X
  1261. Xstruct IntuiText IText[] =
  1262. X  {
  1263. X    { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "New", NULL },
  1264. X    { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Open", NULL },
  1265. X    { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Save", NULL },
  1266. X    { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "SaveAs", NULL },
  1267. X    { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Print", NULL },
  1268. X    { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "NLQ", NULL },
  1269. X    { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Draft", NULL },
  1270. X    { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "About...", NULL },
  1271. X    { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Quit", NULL },
  1272. X    { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Undo", NULL },
  1273. X    { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Cut", NULL },
  1274. X    { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Copy", NULL },
  1275. X    { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Paste", NULL },
  1276. X    { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Erase All", NULL },
  1277. X    { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Sound", NULL },
  1278. X    { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Auto Save", NULL },
  1279. X    { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Have Your Cake", NULL },
  1280. X    { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Eat It Too", NULL } 
  1281. X  };
  1282. X
  1283. Xstruct MenuItem M0I4[] = 
  1284. X  {
  1285. X    {&M0I4[ 1],  56,   2,  80+CHECKWIDTH,  10,
  1286. X      ITEMTEXT|HIGHCOMP|ITEMENABLED,
  1287. X      0, (APTR)&IText[ 5], NULL, NULL, NULL, MENUNULL},
  1288. X    {NULL,  56,  12,  80+CHECKWIDTH,  10,
  1289. X      ITEMTEXT|HIGHCOMP|ITEMENABLED,
  1290. X      0, (APTR)&IText[ 6], NULL, NULL, NULL, MENUNULL}
  1291. X  };
  1292. X
  1293. Xstruct MenuItem M0[] = 
  1294. X  {
  1295. X    {&M0[ 1],   0,   0,  80+CHECKWIDTH,  10,
  1296. X      ITEMTEXT|HIGHCOMP|ITEMENABLED,
  1297. X      0, (APTR)&IText[ 0], NULL, NULL, NULL, MENUNULL},
  1298. X    {&M0[ 2],   0,  10,  80+CHECKWIDTH,  10,
  1299. X      ITEMTEXT|HIGHCOMP|ITEMENABLED|COMMSEQ,
  1300. X      0, (APTR)&IText[ 1], NULL, 'O', NULL, MENUNULL},
  1301. X    {&M0[ 3],   0,  20,  80+CHECKWIDTH,  10,
  1302. X      ITEMTEXT|HIGHCOMP|ITEMENABLED|COMMSEQ,
  1303. X      0, (APTR)&IText[ 2], NULL, 'S', NULL, MENUNULL},
  1304. X    {&M0[ 4],   0,  30,  80+CHECKWIDTH,  10,
  1305. X      ITEMTEXT|HIGHCOMP|ITEMENABLED,
  1306. X      0, (APTR)&IText[ 3], NULL, NULL, NULL, MENUNULL},
  1307. X    {&M0[ 5],   0,  40,  80+CHECKWIDTH,  10,
  1308. X      ITEMTEXT|HIGHCOMP|ITEMENABLED,
  1309. X      0, (APTR)&IText[ 4], NULL, NULL, &M0I4[0], MENUNULL},
  1310. X    {&M0[ 6],   0,  50,  80+CHECKWIDTH,  10,
  1311. X      ITEMTEXT|HIGHCOMP|ITEMENABLED,
  1312. X      0, (APTR)&IText[ 7], NULL, NULL, NULL, MENUNULL},
  1313. X    {NULL,   0,  60,  80+CHECKWIDTH,  10,
  1314. X      ITEMTEXT|HIGHCOMP|ITEMENABLED|COMMSEQ,
  1315. X      0, (APTR)&IText[ 8], NULL, 'Q', NULL, MENUNULL}
  1316. X  };
  1317. X
  1318. Xstruct MenuItem M1[] = 
  1319. X  {
  1320. X    {&M1[ 1],   0,   0,  72+CHECKWIDTH,  10,
  1321. X      ITEMTEXT|HIGHCOMP|ITEMENABLED|COMMSEQ,
  1322. X      0, (APTR)&IText[ 9], NULL, 'Z', NULL, MENUNULL},
  1323. X    {&M1[ 2],   0,  10,  72+CHECKWIDTH,  10,
  1324. X      ITEMTEXT|HIGHCOMP|ITEMENABLED|COMMSEQ,
  1325. X      0, (APTR)&IText[10], NULL, 'X', NULL, MENUNULL},
  1326. X    {&M1[ 3],   0,  20,  72+CHECKWIDTH,  10,
  1327. X      ITEMTEXT|HIGHCOMP|ITEMENABLED|COMMSEQ,
  1328. X      0, (APTR)&IText[11], NULL, 'C', NULL, MENUNULL},
  1329. X    {&M1[ 4],   0,  30,  72+CHECKWIDTH,  10,
  1330. X      ITEMTEXT|HIGHCOMP|ITEMENABLED|COMMSEQ,
  1331. X      0, (APTR)&IText[12], NULL, 'V', NULL, MENUNULL},
  1332. X    {NULL,   0,  40,  72+CHECKWIDTH,  10,
  1333. X      ITEMTEXT|HIGHCOMP,
  1334. X      0, (APTR)&IText[13], NULL, NULL, NULL, MENUNULL}
  1335. X  };
  1336. X
  1337. Xstruct MenuItem M2[] = 
  1338. X  {
  1339. X    {&M2[ 1],   0,   0, 112+CHECKWIDTH,  10,
  1340. X      ITEMTEXT|HIGHCOMP|ITEMENABLED,
  1341. X      0, (APTR)&IText[14], NULL, NULL, NULL, MENUNULL},
  1342. X    {&M2[ 2],   0,  10, 112+CHECKWIDTH,  10,
  1343. X      ITEMTEXT|HIGHCOMP|ITEMENABLED|MENUTOGGLE|CHECKIT|CHECKED,
  1344. X      0, (APTR)&IText[15], NULL, NULL, NULL, MENUNULL},
  1345. X    {&M2[ 3],   0,  20, 112+CHECKWIDTH,  10,
  1346. X      ITEMTEXT|HIGHCOMP|ITEMENABLED|CHECKIT|CHECKED,
  1347. X      0, (APTR)&IText[16], NULL, NULL, NULL, MENUNULL},
  1348. X    {NULL,   0,  30, 112+CHECKWIDTH,  10,
  1349. X      ITEMTEXT|HIGHCOMP|ITEMENABLED|CHECKIT,
  1350. X      0, (APTR)&IText[17], NULL, NULL, NULL, MENUNULL}
  1351. X  };
  1352. X
  1353. Xstruct Menu TheMenu[] =
  1354. X  {
  1355. X    { &TheMenu[ 1],   0,   0,  80+CHECKWIDTH,  10,
  1356. XMENUENABLED," Project                         ", &M0[0]},
  1357. X    { &TheMenu[ 2], 112,   0,  72+CHECKWIDTH,  10,
  1358. XMENUENABLED,"  Edit                         ", &M1[0]},
  1359. X    {  NULL       , 216,   0, 112+CHECKWIDTH,  10,
  1360. XMENUENABLED," Preferences                         ", &M2[0]} 
  1361. X  };
  1362. X
  1363. Xstruct Menu *MyMenu = &TheMenu[0];
  1364. X
  1365. X/*****************************************/
  1366. X/*         End of generated code         */
  1367. X/*****************************************/
  1368. END_OF_FILE
  1369. if test 4525 -ne `wc -c <'menu.c'`; then
  1370.     echo shar: \"'menu.c'\" unpacked with wrong size!
  1371. fi
  1372. chmod +x 'menu.c'
  1373. # end of 'menu.c'
  1374. fi
  1375. if test -f 'menu.o.uu' -a "${1}" != "-c" ; then 
  1376.   echo shar: Will not clobber existing file \"'menu.o.uu'\"
  1377. else
  1378. echo shar: Extracting \"'menu.o.uu'\" \(2463 characters\)
  1379. sed "s/^X//" >'menu.o.uu' <<'END_OF_FILE'
  1380. Xbegin 700 menu.o
  1381. XM```#YP````````/H`````3(```````/J```!"P`!`0``$P```````````.@`^
  1382. XM``````$!```3````````````X@```````0$``!,```````````#<```````!I
  1383. XM`0``$P```````````-0```````$!```3````````````S@```````0$``!,`@
  1384. XM``````````#*```````!`0``$P```````````,0```````$!```3````````X
  1385. XM````N@```````0$``!,```````````"T```````!`0``$P```````````*X`&
  1386. XM``````$!```3````````````J@```````0$``!,```````````"D```````!Y
  1387. XM`0``$P```````````)X```````$!```3````````````E````````0$``!,`P
  1388. XM``````````".```````!`0``$P```````````(0```````$!```3````````\
  1389. XM````=````````0$``!,```````````!H`````````8H`.``"`&,`"@!2````U
  1390. XM`````&0`````````````__\``````#@`#`!C``H`4@````````!X````````=
  1391. XM`````/__```!S@``````8P`*`%(```````````````````````#__P```?``[
  1392. XM```*`&,`"@!6`````````!0`````3P``````__\```(2````%`!C``H`5@``9
  1393. XM```````H`````%,``````/__```"-````!X`8P`*`%(`````````/```````(
  1394. XM``````#__P```E8````H`&,`"@!2`````````%````````````%H__\```)XN
  1395. XM````,@!C``H`4@````````",`````````````/__`````````#P`8P`*`%8`Z
  1396. XM````````H`````!1``````#__P```KP``````%L`"@!6`````````+0`````<
  1397. XM6@``````__\```+>````"@!;``H`5@````````#(`````%@``````/__```#>
  1398. XM`````!0`6P`*`%8`````````W`````!#``````#__P```R(````>`%L`"@!6J
  1399. XM`````````/``````5@``````__\`````````*`!;``H`0@````````$$````8
  1400. XM`````````/__```#9@``````@P`*`%(````````!&`````````````#__P``=
  1401. XM`X@````*`(,`"@%;`````````2P`````````````__\```.J````%`"#``H!X
  1402. XM4P````````%``````````````/__`````````!X`@P`*`%,````````!5```E
  1403. XM``````````#__P```^H``````&,`"@`!````1@```:P`````````````!`@`8
  1404. XM<````%L`"@`!````)@```IH`````````````````V````(,`"@`!````````^
  1405. XM`T0``````````````\Q.<0```^P````G`````````6@```%Z```!G````:P`9
  1406. XM``&^```!S@```>````'P```"`@```A(```(D```"-````D8```)0```"5@``&
  1407. XM`F@```**```"F@```JP```*\```"S@```MX```+P```#`````Q(```,T```#R
  1408. XM1````U8```-F```#>````X@```.:```#O````\P```/>```#Z@```_P```0:B
  1409. XM```$)@```!4````!````#````"`````T````2````%P```!P````A````)@`0
  1410. XM``"L````P````-0```#H````_````1````$D```!.````4P```%@```#V@``>
  1411. XM`_@```06`````````^\!```"7TE497AT`````````0```E]-,$DT```````!T
  1412. XM:`$```%?33`````!K`$```%?33$````"F@$```%?33(````#1`$```)?5&AE8
  1413. XM365N=0```\P!```"7TUY365N=0````0F`````````_(```/H`````3$`````=
  1414. XM``/I````.R!0<F5F97)E;F-E<R`@("`@("`@("`@("`@("`@("`@("`@("``9
  1415. XM("!%9&ET("`@("`@("`@("`@("`@("`@("`@("`@(``@4')O:F5C="`@("`@]
  1416. XM("`@("`@("`@("`@("`@("`@("``16%T($ET(%1O;P``2&%V92!9;W5R($-A@
  1417. XM:V4``$%U=&\@4V%V90!3;W5N9`!%<F%S92!!;&P`4&%S=&4`0V]P>0``0W5T.
  1418. XM`%5N9&\``%%U:70``$%B;W5T+BXN``!$<F%F=`!.3%$`4')I;G0`4V%V94%SJ
  1419. X6``!3879E``!/<&5N``!.97<````#\@!$$
  1420. X``
  1421. Xend
  1422. Xsize 1732
  1423. END_OF_FILE
  1424. if test 2463 -ne `wc -c <'menu.o.uu'`; then
  1425.     echo shar: \"'menu.o.uu'\" unpacked with wrong size!
  1426. fi
  1427. # end of 'menu.o.uu'
  1428. fi
  1429. if test -f 'menu.test' -a "${1}" != "-c" ; then 
  1430.   echo shar: Will not clobber existing file \"'menu.test'\"
  1431. else
  1432. echo shar: Extracting \"'menu.test'\" \(324 characters\)
  1433. sed "s/^X//" >'menu.test' <<'END_OF_FILE'
  1434. Xmenu,,Project
  1435. Xitem,,New,,
  1436. Xitem,,Open,,O
  1437. Xitem,,Save,,S
  1438. Xitem,,SaveAs,,
  1439. Xitem,,Print,,
  1440. Xsubi,,NLQ,,
  1441. Xsubi,,Draft,,
  1442. Xitem,,About...,,
  1443. Xitem,,Quit,,Q
  1444. Xmenu,,Edit
  1445. Xitem,,Undo,,Z
  1446. Xitem,,Cut,,X
  1447. Xitem,,Copy,,C
  1448. Xitem,,Paste,,V
  1449. Xitem,D,Erase All,,
  1450. Xmenu,,Preferences
  1451. Xitem,,Sound,,
  1452. Xitem,CTS,Auto Save,,
  1453. Xitem,CS,Have Your Cake,,
  1454. Xitem,C,Eat It Too,,
  1455. END_OF_FILE
  1456. if test 324 -ne `wc -c <'menu.test'`; then
  1457.     echo shar: \"'menu.test'\" unpacked with wrong size!
  1458. fi
  1459. chmod +x 'menu.test'
  1460. # end of 'menu.test'
  1461. fi
  1462. if test -f 'testmenu.c' -a "${1}" != "-c" ; then 
  1463.   echo shar: Will not clobber existing file \"'testmenu.c'\"
  1464. else
  1465. echo shar: Extracting \"'testmenu.c'\" \(5699 characters\)
  1466. sed "s/^X//" >'testmenu.c' <<'END_OF_FILE'
  1467. X/* TestMenu.c V1.0 (14-oct-90) - by Hans Jansen
  1468. X *
  1469. X * Program to exercise the output from MakeMenu V1.0, enabling you to
  1470. X * quickly prototype a menu for your own application program.
  1471. X *
  1472. X * This program was adapted from the RKM example Menus.c (from chapter
  1473. X * Intuition:Menus, page 125-133; also published on Fish Disk #344, the
  1474. X * "Libs&DevsCompanion"). The original program carried the following
  1475. X * copyright statement:
  1476. X */
  1477. X/* Copyright (c) 1990 Commodore-Amiga, Inc.
  1478. X *
  1479. X * This example is provided in electronic form by Commodore-Amiga, Inc. for
  1480. X * use with the 1.3 revisions of the Addison-Wesley Amiga reference manuals. 
  1481. X * The 1.3 Addison-Wesley Amiga Reference Manual series contains additional
  1482. X * information on the correct usage of the techniques and operating system
  1483. X * functions presented in this example.  The source and executable code of
  1484. X * this example may only be distributed in free electronic form, via bulletin
  1485. X * board or as part of a fully non-commercial and freely redistributable
  1486. X * diskette.  Both the source and executable code (including comments) must
  1487. X * be included, without modification, in any copy.  This example may not be
  1488. X * published in printed form or distributed with any commercial product.
  1489. X * However, the programming techniques and support routines set forth in
  1490. X * this example may be used in the development of original executable
  1491. X * software products for Commodore Amiga computers.
  1492. X * All other rights reserved.
  1493. X * This example is provided "as-is" and is subject to change; no warranties
  1494. X * are made.  All use is at your own risk.  No liability or responsibility
  1495. X * is assumed.
  1496. X */
  1497. X
  1498. X#include <exec/types.h>
  1499. X#include <intuition/intuition.h>
  1500. X#include <intuition/intuitionbase.h>
  1501. X#include <libraries/dos.h>
  1502. X#include <stdlib.h>
  1503. X#include <stdio.h>
  1504. X#include <string.h>
  1505. X
  1506. X/* Use lowest non-obsolete version that supplies the functions you need. */
  1507. X#define LIB_REV 33
  1508. X
  1509. X/* prototypes */
  1510. XUBYTE    handleIDCMP(struct Window *);
  1511. XVOID     OpenAll(VOID);
  1512. XVOID     cleanExit(int);
  1513. X
  1514. X/* Globals */
  1515. Xstruct   IntuitionBase *IntuitionBase = NULL;
  1516. Xstruct   GfxBase       *GfxBase = NULL; 
  1517. Xstruct   Window *window = NULL;
  1518. X
  1519. Xstruct IntuiText WinText =
  1520. X       {3, 0, JAM2, 20, 20, NULL, "Activate MenuItem or CloseGadget",NULL};
  1521. X
  1522. Xstruct NewWindow NewWindow = {
  1523. X    0, 10, 640, 100, 2, 1, MENUPICK|CLOSEWINDOW,
  1524. X    WINDOWDRAG|WINDOWDEPTH|WINDOWCLOSE|ACTIVATE|NOCAREREFRESH,
  1525. X    NULL, NULL, "TestMenu V1.0 (12-oct-90) - by Hans Jansen",
  1526. X    NULL, NULL, 0, 0, -1, -1, WBENCHSCREEN
  1527. X    };
  1528. X
  1529. Xextern struct Menu *MyMenu;
  1530. X
  1531. XVOID main (int argc, char *argv[])
  1532. X{
  1533. X/* Declare variables here */
  1534. XULONG  signalmask, signals;
  1535. XUBYTE  done = 0;
  1536. X
  1537. XOpenAll();
  1538. X
  1539. X/* Set up the signals that you want to hear about ... */
  1540. Xsignalmask = 1L << window->UserPort->mp_SigBit;
  1541. X
  1542. X/* And wait to hear from your signals */      
  1543. Xwhile( !done )
  1544. X   {
  1545. X   signals = Wait(signalmask);    
  1546. X   if(signals & signalmask)
  1547. X      done = handleIDCMP(window);
  1548. X   };
  1549. X
  1550. X/* Exit the program */
  1551. XcleanExit(RETURN_OK);
  1552. X}
  1553. X
  1554. X
  1555. X/* Handle the IDCMP messages */
  1556. XUBYTE handleIDCMP( struct Window *win )
  1557. X{
  1558. XUBYTE  flag = 0;
  1559. XUSHORT code, selection, flags;
  1560. Xstruct IntuiMessage *message = NULL;
  1561. XULONG  class, menuNum, itemNum, subNum;
  1562. X
  1563. X/* Examine pending messages */
  1564. Xwhile(message = (struct IntuiMessage *)GetMsg(win->UserPort))
  1565. X   {
  1566. X   class = message->Class;
  1567. X   code = message->Code;
  1568. X/* When we're through with a message, reply */
  1569. X   ReplyMsg((struct Message *)message);
  1570. X   
  1571. X/* See what events occurred */
  1572. X   switch( class )
  1573. X      {
  1574. X      case CLOSEWINDOW:
  1575. X         flag = 1;
  1576. X         break;
  1577. X      case MENUPICK:
  1578. X         selection = code;
  1579. X         while(selection != -1) /* MENUNULL does not work for PDC V3.33... */
  1580. X            {
  1581. X/*    (uncomment this to see why...)
  1582. X        printf ("selection = %x, MENUNULL = %x\n", selection, MENUNULL);
  1583. X*/
  1584. X            menuNum = MENUNUM(selection);
  1585. X            itemNum = ITEMNUM(selection);
  1586. X            subNum  = SUBNUM(selection);
  1587. X            flags = ((struct MenuItem *)
  1588. X                    ItemAddress(MyMenu,(LONG)selection))->Flags;
  1589. X        /* Show the selection (in the invoking CLI window!) */
  1590. X            printf("Selected menu %d, item %d", menuNum, itemNum);
  1591. X        if (subNum != NOSUB) printf (", subitem %d", subNum);
  1592. X            if(flags&CHECKED) printf(" (Checked) ");
  1593. X        printf ("\n");
  1594. X        /* See if there are more selections */
  1595. X            selection = ((struct MenuItem *)ItemAddress
  1596. X              (MyMenu,(LONG)selection))->NextSelect;
  1597. X         } /* end while */
  1598. X         break; /* case of MENUPICK */
  1599. X      default:
  1600. X         break;
  1601. X      } /* end switch */
  1602. X   } /* end while */
  1603. Xreturn(flag);
  1604. X}
  1605. X
  1606. X
  1607. X/* Open the needed libraries, windows, etc. */
  1608. XVOID OpenAll (VOID)
  1609. X{
  1610. X/* Open the Intuition Library */
  1611. XIntuitionBase = (struct IntuitionBase *)
  1612. X    OpenLibrary( "intuition.library",LIB_REV);
  1613. Xif(IntuitionBase == NULL)
  1614. X    cleanExit(RETURN_WARN);
  1615. X
  1616. X/* Open the Graphics Library */
  1617. XGfxBase = (struct GfxBase *)
  1618. X    OpenLibrary("graphics.library", LIB_REV);
  1619. Xif(GfxBase == NULL)
  1620. X    cleanExit(RETURN_WARN);
  1621. X
  1622. X/* Open the window */
  1623. Xwindow = OpenWindow(&NewWindow);
  1624. Xif(window == NULL)
  1625. X    cleanExit(RETURN_WARN);
  1626. X
  1627. X/* Give a brief explanation of the program */
  1628. XPrintIText(window->RPort,&WinText,0,0);
  1629. X
  1630. X/* attach the menu to the window */
  1631. XSetMenuStrip(window, MyMenu);
  1632. X}
  1633. X
  1634. X
  1635. X/* Free up all the resources that we where using */
  1636. XVOID cleanExit (int returnValue)
  1637. X{
  1638. Xif(window)
  1639. X   {
  1640. X/* If there is a menu strip, then remove it */
  1641. X   if(window->MenuStrip)
  1642. X      ClearMenuStrip(window);
  1643. X
  1644. X/* Close the window */
  1645. X   CloseWindow(window);
  1646. X   }
  1647. X
  1648. X/* Close the library, and then exit */
  1649. Xif(GfxBase)
  1650. X   CloseLibrary((struct Library *)GfxBase);
  1651. X
  1652. Xif(IntuitionBase)
  1653. X   CloseLibrary((struct Library *)IntuitionBase);
  1654. Xexit(returnValue);
  1655. X}
  1656. END_OF_FILE
  1657. if test 5699 -ne `wc -c <'testmenu.c'`; then
  1658.     echo shar: \"'testmenu.c'\" unpacked with wrong size!
  1659. fi
  1660. chmod +x 'testmenu.c'
  1661. # end of 'testmenu.c'
  1662. fi
  1663. if test -f 'testmenu.o.uu' -a "${1}" != "-c" ; then 
  1664.   echo shar: Will not clobber existing file \"'testmenu.o.uu'\"
  1665. else
  1666. echo shar: Extracting \"'testmenu.o.uu'\" \(2424 characters\)
  1667. sed "s/^X//" >'testmenu.o.uu' <<'END_OF_FILE'
  1668. Xbegin 700 testmenu.o
  1669. XM```#YP````````/H`````3(```````/J````%`````````````````,``0``-
  1670. XM%``4`````````SP`````````"@*``&0"`0```P```A`.``````````````,00
  1671. XM````````````````_____P`!```#[`````(````!````&````#H````````#$
  1672. XM[P$```1?26YT=6ET:6]N0F%S90````````$```)?1V9X0F%S90````0!```":
  1673. XM7W=I;F1O=P`````(`0```E]7:6Y497AT````#`$```-?3F5W5VEN9&]W````%
  1674. XM```@`````````_(```/H`````3$```````/I````V$Y5__9(YQP`<``H`$ZYX
  1675. XM```!FG`!('D````((&@`5A(H``]T`!0!(@+CH"8`2H1F(B\#3KD`````6$\J*
  1676. XM`,"#9Q`O.0````A.N0```&183R@`8-I"ITZY```"3%A/3-\`.$Y=3G5.5?_D:
  1677. XM2.<?.$7Y`````'``+`!P`"@`(&T`""\H`%9.N0````!83R@`9P`!`B!$*V@`Q
  1678. XM%/_P($0[:``8__PO!$ZY`````%A/<``@+?_P3KD`````````S@```@````#67
  1679. XM```!``````````&,<`$L`&```+AP`#`M__Q(P"8`#(/_____9P``H"`#`H``P
  1680. XM```?*$`@`^J``H`````_)D!P"R(#X*$"@0```!\J`2\#+SD`````3KD`````*
  1681. XM4$\@0#`H``Q(P"X`+PLO#$AY```"]DZ2WOP`#`R%````'V<,+P5(>0```NA.=
  1682. XMDE!/(`<"@````0!G"DAY```"W$Z26$](>0```MI.DEA/+P,O.0````!.N0``W
  1683. XM``!03R!`,"@`($C`)@!@`/]:8````F``_NP@!DS?'/A.74YU3E4``$CG`#!%D
  1684. XM^0````A'^0```DQ(>``A2'D```+(3KD`````4$\CP``````@.0````!F"$AX+
  1685. XM``5.DUA/2'@`(4AY```"MDZY`````%!/(\`````$(#D````$9@A(>``%3I-8]
  1686. XM3TAY````($ZY`````%A/)(`@$F8(2'@`!4Z36$]"IT*G2'D````,(%(O*``R)
  1687. XM3KD`````WOP`$"\Y`````"\23KD`````4$],WPP`3EU.=4Y5```O"D7Y````_
  1688. XM""`29QP@4B`H`!QG"B\23KD`````6$\O$DZY`````%A/(#D````$9PXO.0``<
  1689. XM``1.N0````!83R`Y`````&<.+SD`````3KD`````6$\O+0`(3KD`````6$\D,
  1690. XM7TY=3G5G<F%P:&EC<RYL:6)R87)Y``!I;G1U:71I;VXN;&EB<F%R>0`*`"`H9
  1691. XM0VAE8VME9"D@`"P@<W5B:71E;2`E9```4V5L96-T960@;65N=2`E9"P@:71E3
  1692. XM;2`E9`!497-T365N=2!6,2XP("@Q,BUO8W0M.3`I("T@8GD@2&%N<R!*86YS+
  1693. XM96X``$%C=&EV871E($UE;G5)=&5M(&]R($-L;W-E1V%D9V5T``!.<0```^P`9
  1694. XM```.`````````!8```!"```!I````<(```'(```!Z@```?````(````"(```7
  1695. XM`E0```)Z```"@@```I````*8````#0````$````.````2````%8```"V````R
  1696. XMO@```,H```$N```!1````5@```%B```!J@```;0```'<`````````^\!```"J
  1697. XM7VUA:6X``````````0```U]H86YD;&5)1$--4````&0!```"7T]P96Y!;&P`Q
  1698. XM``&:`0```U]C;&5A;D5X:70``````DR!```"7U=A:70````````!````-($`6
  1699. XM``)?<')I;G1F``````$```!N@0```E]'971-<V<``````0```(2!```#7U)EK
  1700. XM<&QY37-G`````````0```*2!```"+F-S=VET8V@````!````LH$```)?37E-O
  1701. XM96YU``````,```$2```!;@```C:!```#7TET96U!9&1R97-S`````@```1@`8
  1702. XM``%T@0```U]/<&5N3&EB<F%R>0````(```&Z```!XH$```-?3W!E;E=I;F1O5
  1703. XM=P`````!```"!H$```-?4')I;G1)5&5X=``````!```"+($```1?4V5T365N]
  1704. XM=5-T<FEP`````````0```CZ!```$7T-L96%R365N=5-T<FEP``````$```)HE
  1705. XM@0```U]#;&]S95=I;F1O=P````$```)R@0``!%]#;&]S94QI8G)A<GD`````U
  1706. XG```"```"B````IZ!```"7V5X:70````````!```"J@````````/RJ
  1707. X``
  1708. Xend
  1709. Xsize 1704
  1710. END_OF_FILE
  1711. if test 2424 -ne `wc -c <'testmenu.o.uu'`; then
  1712.     echo shar: \"'testmenu.o.uu'\" unpacked with wrong size!
  1713. fi
  1714. # end of 'testmenu.o.uu'
  1715. fi
  1716. echo shar: End of archive 1 \(of 2\).
  1717. cp /dev/null ark1isdone
  1718. MISSING=""
  1719. for I in 1 2 ; do
  1720.     if test ! -f ark${I}isdone ; then
  1721.     MISSING="${MISSING} ${I}"
  1722.     fi
  1723. done
  1724. if test "${MISSING}" = "" ; then
  1725.     echo You have unpacked both archives.
  1726.     rm -f ark[1-9]isdone
  1727. else
  1728.     echo You still need to unpack the following archives:
  1729.     echo "        " ${MISSING}
  1730. fi
  1731. ##  End of shell archive.
  1732. exit 0
  1733. -- 
  1734. Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
  1735. Mail comments to the moderator at <amiga-request@uunet.uu.net>.
  1736. Post requests for sources, and general discussion to comp.sys.amiga.misc.
  1737.